Question based from this: Hide columns based on group

I have the column which is displayed and hidden based on the Boolean Parameter (Display by Order) True or False.

The columns in the report are the following:

Customer         Order        Charge1      Charge2    Charge3
CNI              XHA156        200.00       150.00      50.00
CNI              TY156         100.00       200.00      100.00
LSI              UXYH          100.00       100.00      100.00   

This is the columns and table displayed when Display by Order is selected as True. However, when it is selected as False, the following is shown:

Customer        Charge1      Charge2    Charge3
CNI             200.00       150.00      50.00
LSI             100.00       100.00      100.00   

However, what it should display is the following:

Customer        Charge1      Charge2    Charge3
CNI             300.00       350.00      150.00
LSI             100.00       100.00      100.00   

The row grouping expression that currently have set is the following:

=IIF(Parameters!Displayorder.Value=true, Fields!customer.Value & Fields!deal.Value, Fields!customer.Value)

However, this does not seem to aggregate the charges. Please let me know how I can modify this report to produce the required output. Help will be immensely appreciated.

有帮助吗?

解决方案

Using the same data as your example:

enter image description here

I have a simple table based on this:

enter image description here

Note that I have one group and I am displaying a header row for this group. As such, all the different charge fields are using the Sum aggregate.

The group has two grouping items:

enter image description here

The expression for the second item is:

=IIf(Parameters!DisplayByOrder.Value, Fields!Order.Value, Nothing)

This expression is saying that if the parameter is True, include grouping by the Order field, otherwise no grouping.

I've also hidden the Order column based on the parameter selection.

Works OK for me when run:

enter image description here

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top