【问题标题】:How to group values in Calculated Field in DevExpress XtraReport Detail Band?如何在 DevExpress XtraReport 详细信息带中对计算字段中的值进行分组?
【发布时间】:2020-09-03 01:40:06
【问题描述】:

我正在尝试将报表从 Crystal Reports 移动到 Repx 并在 DevExpress XtraReports 中设计报表。

现有水晶报表代码如下:

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 示例那样进行分组?

【问题讨论】:

    标签: .net crystal-reports devexpress xtrareport


    【解决方案1】:

    Parent Relationship Traversal Operator ('^') 允许您将处理组中的组值与表达式中当前处理的记录的值进行比较。如果报表按ID 列分组,并且您想在详细信息带中汇总当前处理组的Balance 列值,请使用以下表达式(替换Sum ({Balance}, {ID}) 函数):

    [][[ID] = [^.ID]].Sum([Balance])

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多