翻譯|使用教程|編輯:楊鵬連|2021-05-11 10:12:15.460|閱讀 233 次
概述:FastReport用戶可以在報告中指定一個或多個變量。變量的概念本文進行了詳細說明。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
FastReport VCL是用于Delphi,C ++ Builder,RAD Studio和Lazarus的報告和文檔創建VCL庫。它提供了可視化模板設計器,可以訪問為30多種格式,并可以部署到云,網站,電子郵件和打印中。
近日,FastReport VCL更新至v6.9,在新版本中,在PDF更新中增加了對以下對象的并行表單支持:文本,替換和圖片。相互之間形式中。同時修復了多個Bug問題。歡迎下載體驗。(旁邊向下按鈕下載)
變量的概念在相應的章節中進行了詳細說明。讓我們簡短地提醒大家要點。
用戶可以在報告中指定一個或多個變量。可以為每個變量分配一個值或表達式,當引用一個變量時將自動計算出該值或表達式。變量可以通過“數據樹”窗口直觀地插入到報表中。將變量用于復合表達式的別名非常方便,而復合表達式經常在報表中使用。
使用變量時,必須使用“ frxVariables”單元。變量由TfrxVariable類表示。
TfrxVariable = class(TCollectionItem)
published
property Name: String; // Name of a variable
property Value: Variant; // Value of a variable
end;
變量列表由TfrxVariables類表示。它包含使用列表所需的所有方法。
TfrxVariables = class(TCollection)
public
// Adds a variable to the end of the list
function Add: TfrxVariable;
// Adds a variable to the given position of the list
function Insert(Index: Integer): TfrxVariable;
// Returns the index of a variable with the given name
function IndexOf(const Name: String): Integer;
// Adds a variable to the specified category
procedure AddVariable(const ACategory, AName: String; const AValue: Variant);
// Deletes a category and all its variables
procedure DeleteCategory(const Name: String);
// Deletes a variable
procedure DeleteVariable(const Name: String);
// Returns the list of categories
procedure GetCategoriesList(List: TStrings; ClearList: Boolean = True);
// Returns the list of variables in the specified category
procedure GetVariablesList(const Category: String; List: TStrings);
// The list of variables
property Items[Index: Integer]: TfrxVariable readonly;
// Values of variables
property Variables[Index: String]: Variant; default;
end;
如果變量列表很長,則按類別將其分組很方便。例如,當具有以下變量列表時:
Customer name
Account number
In total
Total vat
可以用以下方式表示它:
Properties
Customer name
Account number
Totals
In total
total vat
有以下限制:
如果您對FastReport感興趣,歡迎加入FastReport QQ交流群:801349317
還想要更多嗎?您可以點擊閱讀【FastReport報表2020最新資源盤點】,查找需要的教程資源。讓人興奮的是FastReport .NET正在慧都網火熱銷售中!>>查看價格詳情
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: