Crystal Reports:全局变量运行总计不显示在标题中

phi*_*ill 5 running-total crystal-reports

使用Crystal Reports我试图在标题中显示所有标签所在的数据库字段的运行总计.

我试图通过将运行总计(RTversion)放入公式字段中,并执行以下操作:

Shared stringvar CurrentVers; 
CurrentVers := {#CurrentVers}; 
Run Code Online (Sandbox Code Playgroud)

然后在页眉部分我有以下内容:

Shared stringvar CurrentVers; 
EvaluateAFter({#currentVers}); 
CurrentVers; 
Run Code Online (Sandbox Code Playgroud)

{#CurrentVers}运行第一大号码.

这是不正确的?

更新:目标是在标签附近的标题中显示最新版本,以显示当前版本的比较内容.

cra*_*aig 4

根据我的经验,运行总计字段仅适用于页脚部分。

您将需要创建手动运行总计。

将公式字段添加到“详细信息”部分,用您要捕获的任何内容填充全局变量。就像是:

//use WhileReadingRecords if the values can be gathered as the report pulls in values from the database.  Otherwise, use WhilePrintingRecords. 
WhileReadingRecords;
Global Stringvar CurrentVers;
//logic here to capture what you want
CurrentVers:=...
Run Code Online (Sandbox Code Playgroud)

将另一个公式字段添加到标题部分。将这两行添加到其中:

WhilePrintingRecords;
Global Stringvar CurrentVers;
Run Code Online (Sandbox Code Playgroud)