变量在报告的第一行返回null [英] Variable returns null at first row in report

查看:119
本文介绍了变量在报告的第一行返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jaspersoft Studio 来构建报告。

I am using Jaspersoft Studio for building reports.

我有一个实际检查列的变量TODAY的空值为not。该值的表达式是

I have a variable which actually checks a column TODAY has null values of not. Expression of that value is

$F{TODAY} == null ? new BigDecimal(0.00) : $F{TODAY}

TODAY列在我的情况下现在具有空值。

TODAY column has null values in my case for now.

首先,上面的表达式为第一行返回null,为其他行返回零。因为TODAY列为空,它应该为每一行返回0

The problem is first the expression above returns null for the first row and zero for the other rows. It should return 0 for every row since TODAY column is null

这可能是什么原因?

推荐答案

问题是将初始值表达式部分留空。
我也在该字段中添加了相同的表达式,现在工作正常。

The problem is leaving "initial value expression" part empty. I added the same expression also to that field and it works fine now.

这篇关于变量在报告的第一行返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆