Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Server 2008 - Adding Row Totals

During a recent client engagement I was asked if there was a quick way to add a row containing totals for each corresponding column in the details row from a Tablix item. The tablix contained about 18 columns, and the person was entering an expression that would sum the value of the field in the corresponding detail rows. Fortunately, SSRS 2008 provides a very simple method that will perform this task.

Assuming that you have a report that contains a Tablix item you can perform the following steps to quickly add a totals row to your report.

1. In the Row Groups Panels, right-click the item labeled Details:

clip_image002

2. Choose Before or After, this will depend on where you want to the totals to appear in the report.

3. Once you make the selection a new row will be added to your report. It will contain an expression for each column in the details that sums the value of each column.

clip_image003clip_image005

It’s just that simple. As always if you have any questions or concerns regarding this post, please feel free to email me pleblanc@pragmaticworks.com

Talk to you soon,

Patrick LeBlanc, founder www.SQLLunch.com and www.TSQLScripts.com.

Visit www.BIDN.com, Bring Business Intelligence to your company.

Comments

No comments.

Leave a Comment

Please register or log in to leave a comment.