Monday, February 22, 2010

SSRS 2008 – Adding a Totals Row

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.

1 comment:

  1. I cannot get this to work. I'm assuming you have to creat a row group first? When I click 'add total' and then 'after' it just creates a blank row with no expressions =(

    ReplyDelete