翻译|使用教程|编辑:杨鹏连|2021-05-11 10:12:15.460|阅读 164 次
概述: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@evget.com
文章转载自:Fast Reports