Sql-server – programmatically generate reports that are emailed as Excel docs from SSRS

sql serverssrs

I've searched already and don't see (or can't decipher) a solution for my issue. I have SSRS emailing a report for 1 district (with 12 retail stores). However, each Region has over 8 Districts, and I need to put each District on its own tab. I have multiple tabs working, but I'd like to avoid creating each sheet if possible. I also need to generate 4 of these master spreadsheets – is there a way to make some sort of template for one worksheet using parameters?
We're using SQL Server 2008 R2 and Report Builder 3.0

Best Answer

Ini. My first thought here is that you could use a List control to iterate across Districts. SQL Server MVP Jes Borland has a great intorductory post on Lists here: http://jesborland.wordpress.com/2010/11/17/the-power-of-reporting-services-%E2%80%93-lists/

Inside the list control will be a rectangle. By setting the Page properties of that rectangle, you can create yours tabs for each District, dynamically setting the Page Name property to an expression that returns the District.

You could configure your dataset (ideally, a stored procedure) to take the Region as a parameter and then you can run this ONE report for each of your Regions and they will all work the same and keep you from having to create multiple copies of the same object.

Assuming I understood your question correctly, this should get you moving in the right direction.