Tuesday, August 16, 2011

Rendering SSRS reports from Command Prompt

Subscriptions is one interesting topic in SSRS. We can create subscriptions that run the report, send them over the email or place the reports in any specific path. But what if the report has a parameter and there are more than 100 values for that parameter? Definitely, creating 100 subscriptions is not the best idea. Now, we can do the same thing using some VB script and render the report through command line.


Below is the VB script that I used to run the report, save the report as excel in a folder, so the user can access it.


I named the Vb script as testreportautomation4.rss and saved it in the temp folder.
now, in the command prompt, I give the path .rss file and the link to my report server.



When the above script is executed, the report will be executed for all the parameter values that were given in the script, and the excels are saved in the path that was given in the 'filename' variable.
For more effective reporting, we can create a link to the databse and get the parameter values from the database instead of hard coding in the script.