首页 > 解决方案 > Crystal Reports,没有从我的公式中获取值以显示在报告字段中

问题描述

我的报告中有记录,其中包含“masterTypeId”和“amount”字段。在我的报告页脚中,我有一个字符串字段“@UnboundString30”。公式为:

(Local NumberVar r;
r := 0;
WhileReadingRecords; 
if{Table.masterTypeId}=2
then r := r + {Table.amount})

公式工作室将保存并关闭。当我运行报告时,@UnboundString30 始终为 0,尽管有许多 masterTypeId 为 2 和许多数量。在我看来,我需要告诉我的字段它应该是 r 的值,但我不知道该怎么做?

谢谢!

标签: crystal-reports

解决方案


看起来你错过了回报。尝试在线添加,如下所示:

Local NumberVar r;
r := 0;
WhileReadingRecords; 
if{Table.masterTypeId}=2
then r := r + {Table.amount};
r; //this is the return

推荐阅读