Report that can be run against multiple companies using a 'company' parameter

I got a support call from a friend yesterday, he wanted to create a report that could be run against any company using a 'company' parameter. 

I didn't know how to do it, but he emailed this morning with the technique that he used, and I'm sharing. 

 

Create a stored procedure. Run it in all companies. 

Open SSRS Report Builder. 

Create a normal valid data source, because the one that we're going to use will not 'test', and can't be used to validate SQL objects. 

Then, create a Data Source called 'Company'. 

'Build' it first, and then go into the expression builder and edit to as shown.

Create the Dataset as shown. Use the valid Data Source for now, we'll change it later. 

Insert a Matrix, follow the wizard. Format the report

When you're ready, go into the Dataset and change the Data Source back to 'Company'

 

That's it! Give it a try, let me know if I left out any steps or didn't explain clearly enough. 

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences