Crystal 报告,未从我的公式中获取值以显示在报告字段中
Crystal Reports, not getting a value out of my formula to display in the report field
我的报告中有记录包含字段“masterTypeId”和“金额”。在我的报告页脚中,我有一个字符串字段“@UnboundString30”。公式为:
(Local NumberVar r;
r := 0;
WhileReadingRecords;
if{Table.masterTypeId}=2
then r := r + {Table.amount})
公式工作室将保存并关闭。当我 运行 时,报告 @UnboundString30 始终为 0,尽管有许多 masterTypeIds 为 2 且数量很多。在我看来,我需要告诉我的字段它应该是 r 的值,但我不知道该怎么做?
谢谢!
您好像漏掉了 return。尝试添加在线,像这样:
Local NumberVar r;
r := 0;
WhileReadingRecords;
if{Table.masterTypeId}=2
then r := r + {Table.amount};
r; //this is the return
我的报告中有记录包含字段“masterTypeId”和“金额”。在我的报告页脚中,我有一个字符串字段“@UnboundString30”。公式为:
(Local NumberVar r;
r := 0;
WhileReadingRecords;
if{Table.masterTypeId}=2
then r := r + {Table.amount})
公式工作室将保存并关闭。当我 运行 时,报告 @UnboundString30 始终为 0,尽管有许多 masterTypeIds 为 2 且数量很多。在我看来,我需要告诉我的字段它应该是 r 的值,但我不知道该怎么做?
谢谢!
您好像漏掉了 return。尝试添加在线,像这样:
Local NumberVar r;
r := 0;
WhileReadingRecords;
if{Table.masterTypeId}=2
then r := r + {Table.amount};
r; //this is the return