Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Variables Jasper报告根据另一个字段的值有条件地对字段求和_Variables_Jasper Reports_Expression_Conditional - Fatal编程技术网

Variables Jasper报告根据另一个字段的值有条件地对字段求和

Variables Jasper报告根据另一个字段的值有条件地对字段求和,variables,jasper-reports,expression,conditional,Variables,Jasper Reports,Expression,Conditional,在Jasper Reports中,能否根据不同字段的值($F{hce},字符串)累积字段($F{adr},double)的变量(double;calculation=Sum) 我试过了 $F{hce} == "Y" ? $F{adr} : 0 我以为我在JR b4中使用了这个功能,但我现在无法使它工作。它只会出现零。是的,你在正确的线路上。检查您的字段是否在正确的波段。尝试将数字字段拖到摘要栏位中。您应该获得一个选项,可以将其聚合为总和。然后,您可以使用如上所述的三元组编辑表达式,这将允许您有

在Jasper Reports中,能否根据不同字段的值(
$F{hce}
,字符串)累积字段(
$F{adr}
,double)的变量(double;calculation=Sum)

我试过了

$F{hce} == "Y" ? $F{adr} : 0

我以为我在JR b4中使用了这个功能,但我现在无法使它工作。它只会出现零。

是的,你在正确的线路上。检查您的字段是否在正确的波段。尝试将数字字段拖到摘要栏位中。您应该获得一个选项,可以将其聚合为总和。然后,您可以使用如上所述的三元组编辑表达式,这将允许您有选择地对内容求和。必须在属性中正确设置波段、数据类型以及重置和增量类型