I have a report that outputs 4 labels per page.
The data are correctly retrieved from an ArrayList of a class that I have made only for the report and are correctly displayed.
In my class there are also 4 booleans named: Show1, Show2, Show3, Show4, that I'm using for adjust the visibility of 4 Text Objects with a White background, 1 for each label:
我有一份报告,每页输出4个标签。从我仅为报表创建并正确显示的类的ArrayList中正确检索数据。在我的课堂上还有4个布尔名为:Show1,Show2,Show3,Show4,我用它来调整4个文本对象的可见性,白色背景,每个标签1个:
if isnull({MyModel.Show1}) then
false
else
if {MyModel.Show1} then
true
else
false
The problem is that the report throws an exception, asking me for a Boolean. But these variables are never null, always false and true when necessary. I have put the null-check for avoid problems, but the exception is thrown without the null check too. I have tried to change the type of the variables, using an int instead of a bool and checking the number, returning true or false if 1 or 0: nothing changes, in this case the exception asks me for an integer.
问题是报告抛出一个异常,问我一个布尔值。但是这些变量永远不会为null,必要时总是false和true。我已经进行了空检查以避免出现问题,但是在没有null检查的情况下抛出了异常。我试图改变变量的类型,使用int而不是bool并检查数字,如果1或0则返回true或false:没有任何变化,在这种情况下异常要求我输入一个整数。
The exception is ErrorKind
with the message A boolean is required here
or A number is required here
in the 2nd case.
例外是ErrorKind,消息需要布尔值,或者在第二种情况下需要一个数字。
I can't understand what is happening...
我无法理解发生了什么......
Any suggestion?
有什么建议吗?
Thanks all
谢谢大家
1 个解决方案
#1
1
Ok, I've solved the problem.
好的,我已经解决了这个问题。
I have realized that the formula wants the condition, not the return value. So the correct formula, in Crystal syntax, is:
我已经意识到公式需要条件,而不是返回值。所以Crystal语法中的正确公式是:
{MyModel.Show1} = true
If the condition is true, the return will be true, else the return will be false, and all work fine.
如果条件为真,则返回为真,否则返回为假,并且一切正常。
#1
1
Ok, I've solved the problem.
好的,我已经解决了这个问题。
I have realized that the formula wants the condition, not the return value. So the correct formula, in Crystal syntax, is:
我已经意识到公式需要条件,而不是返回值。所以Crystal语法中的正确公式是:
{MyModel.Show1} = true
If the condition is true, the return will be true, else the return will be false, and all work fine.
如果条件为真,则返回为真,否则返回为假,并且一切正常。