Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to sum a column in a group footer.
The column calculates the revenue made from each customer for the month.

The revenue for each customer gets calculated by the following expression:

C#
=Switch(Fields!currency.Value = "US $",
Switch(
	Fields!RatePer.Value = "Load", Count(Fields!tripId.Value) * Fields!rate.Value,
	Fields!RatePer.Value = "Ton", Sum(Fields!tonnage.Value) * Fields!rate.Value,
	Fields!RatePer.Value = "Litre", Sum(Fields!tonnage.Value) * Fields!rate.Value,
	Fields!RatePer.Value = "Kilogram", Sum(Fields!tonnage.Value) * Fields!rate.Value
))



If the rate is USD and per Load it calculates the revenue by number of loads * rate.
If the rate is per ton it calculates the revenue by tonnage * rate.

The .rdlc file just shows it as «Expr» so the "Add total" function does not work.

How do I sum the total revenue at the bottom of the column?
Please help!

What I have tried:

I have tried using the SUM function in the expression but it cannot work that way
Posted
Updated 3-Jun-16 4:11am

1 solution

Same like your requirement.

Reference:
Sum Values in Microsoft Report Viewer[^]

if you like the solution please give a response.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900