Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I want to perform the row total and column total of a rdlc report using the Matrix Tool.

Present RDLC Report Structure
-------------------
|City | Year |
-------------------
|City | Population |
-------------------

Output of RDLC Report

--------------------------------------------------------------
|City | 2011 2012 | 2013 | 2014 |
--------------------------------------------------------------
|Banglore | 9000000 | 9000970 | 9001166 | 9002008 |
--------------------------------------------------------------
|Hyderabad | 8001456 | 8001478 | 8001961 | 8002085 |
--------------------------------------------------------------
|Mumbai | 10010490 | 10012871 | 10012866 | 10013008 |
---------------------------------------------------------------
|NewDelhi | 10010120 | 10011011 | 10012016 | 10012708 |
--------------------------------------------------------------


Required Output

--------------------------------------------------------------------------
|City | 2011 | 2012 | 2013 | 2014 | Total |
--------------------------------------------------------------------------
|Banglore | 9000000 | 9000970 | 9001166 | 9002008 | 36004144 |
--------------------------------------------------------------------------
|Hyderabad | 8001456 | 8001478 | 8001961 | 8002085 | 32006980 |
--------------------------------------------------------------------------
|Mumbai | 10010490 | 10012871 | 10012866 | 10013008 | 40049235 |
--------------------------------------------------------------------------
|NewDelhi | 10010120 | 10011011 | 10012016 | 10012708 | 40045855 |
--------------------------------------------------------------------------
|Total | 37022066 | 37026330 | 37028009 | 37028009 | 148106214 |
--------------------------------------------------------------------------


Please let me know how to create the RDLC Report Structutre for the above format.


Thanks and Regards
Santosh
Posted
Updated 13-Mar-18 3:52am
Comments
Schatak 17-Jun-14 3:13am    
why not to use matrix?

1 solution

You can achieve the required totals using scoped SUM expressions. Supposing you have created the needed rows and columns groups, use a matrix with the following data arrangement.


Note in your case it is [Sum(Amount)] instead of [Sum(Value)] in my case.

For showing the totals just add the row and the column outside the groups item and Month respectively.

Select the [item] row (second row) and right click, go to insert row and select outside group - below.


To add the column select the [month] column (second column), right click it and select insert column then outside group - right.


Now add these expressions in the highlighted cells in red, check the first image.

1: =Sum(Fields!Amount.Value,"Month")

2: =Sum(Fields!Amount.Value,"item")

It will produce the following matrix:
 
Share this answer
 

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