SQL Reporting Services Tips  

Main | About us | Contact us  

 

22) Create a drill-down table

Drag the table object on to the report detail area and put the field you want to be at the bottom of the drill down into the first textbox (In this example the table will drill-down from Continent - (Country/Area) - Year - Date) and then right-click on the detail row selector and select add group:

Select Fields!Continent.Value as the expression to group on

Now bring up the textbox properties for the far left textbox in the newly created Continent group and set the Value to Fields!Continent.Value and the Name to Continent

Now repeat this process for the next group Fields!Name.Value

If you have values you wish to Total for each group add them in on the same line as the relevant group using the Sum() function on all but the detail line

If (for example) your dataset when down to individual Invoice level you could add more columns to the right and then put the Invoice details (Date, Reference Number, Customer etc) on the detail line

Note: You can only use Aggregate functions on the Groupings lines (other than the Field its been grouped on)

Now to give the table the drill-down effect you need to set each rows visibility to Hidden and the Toggle Item to the textbox above, so for the detail row we set the Toggle Item to the OrderYear textbox (OrderYear row to Name, Name row to Continent) click on the Detail row to get the properties

If you want to have totals (at the bottom) for each grouping these would go in the groups below the detail line and these would also need to have their visibilities set, I usual just delete them.

One effect I like the look of is to indent each group (more than the other) by change the textbox Left property on the Format tab:

Once these have all been set you ready to deploy and it should look something like:

And something like this from Report Manager

© Copyright 2009. Reporting Services Tips.