vb.net - 未找到任何记录时,晶体报表的公式字段中有错误

标签 vb.net crystal-reports

我正在制作 Crystal 报表。
我想在每页的页脚上显示记录的总和。
因此,我在具有以下公式的 Crystal 报表中添加了公式字段。

whileprintingrecords;
numbervar PageTotl;

if isNULL({Customer.PaidAmount})Then 
0
else
PageTotl:=PageTotl + {Customer.PaidAmount}

如果没有符合给定条件的记录,则会在下面给出错误。

enter image description here

我必须在上面的代码中进行什么样的更改,因此它也可以处理0条记录。

最佳答案

首先,我遇到了同样的错误,将公式固定为以下公式后,没有错误出现:

whileprintingrecords;
numbervar PageTotl;

if isNULL({Customer.PaidAmount})Then 
0
else
PageTotl:=PageTotl + ToNumber({Customer.PaidAmount})

关于vb.net - 未找到任何记录时,晶体报表的公式字段中有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40873941/

相关文章:

C# 如何使用 LINQ 填充 Crystal 报表

c# - 在 Visual Basic(而不是 C#)中访问属性

vb.net - 在 Visual Basic 中使用循环打印平方数

android - Visual Basic 与 Android 兼容吗?

if-statement - if-else Crystal Report 公式中多个执行行的正确语法

function - Crystal Reports 自定义 IsNull 函数

crystal-reports - 具有多个 OR 运算符的 Crystal 报告抑制公式不起作用

JavaScript 自动完成数组无法与 vb.net 中的 WebMethod 一起使用

vb.net - 静态局部变量是不好的做法吗?

html - Crystal 报表 HTML 大小