如何在DevExpress XtraReport明细栏中的计算字段中对值进行分组?

问题描述

我试图将报表从Crystal Reports移至Repx,并在DevExpress XtraReports中设计报表。

现有的Crystal Reports代码如下:

if {Balance} = 0 then 0 
else if IsNull({Series}) Then ({Balance} / Sum ({Balance},{ID})*100) -- Grouped by ID on this line
else ({Balance} / Sum ({Balance},{Series})*100) -- Grouped by Series on this line

我试图模仿此代码并将其移至XtraReports中,如下所示。

Iif([Balance] = 0,'0',Iif(IsNull([Series]),(([Balance] / Sum([Balance])) * 100),([Balance] / Sum([Balance])) * 100)) -- As you can see on this and the above line I am missing the group 
                                     -- by "ID" and "Series" I don't believe the syntax exists in XtraReports. 

这在详细信息区域中是完整的,因此不能使用常规方法添加组页眉/页脚等。

是否可以像XtraReports中的Crystal Report示例一样进行分组?

解决方法

通过Parent Relationship Traversal Operator ('^'),您可以将已处理组中的组值与表达式中当前已处理记录的值进行比较。如果报告按ID列分组,并且您想在明细栏中汇总当前处理组的Balance列值,请使用以下表达式(替换{{1} }函数):

Sum ({Balance},{ID})

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...