Link to home
Create AccountLog in
Avatar of OCUW
OCUWFlag for United States of America

asked on

SSRS batch scripting a series of reports to run and create export files

I am utilizing Microsoft SQL 2008 R2 Reporting Services and I would like to create batch files that will process a series of SSRS reports along with their required parameter’s to run on demand.
Currently I have a batch file that runs my Crystal reports that each of the reports can be called based on the required parameters and exported to a specific filename and PDF or excel file.  

This process is needed to run approximately forty reports during our month end close and the timeline is not standard enough to run as a scheduled subscription.

My current method of batching Crystal reports utilizes the Groff crexport utility written for Crystal utilizing this I have a series of predefined commands as shown below to process all of my key reports as shown below.  

crexport -Uusername –Ppassword -F"Y:\Reports\ TOP Accounts .rpt"
-O"C:\REPORTS\TOP Accounts.PDF"  -XFile –Epdf  -Sdatasource -N1 -A@YEAR -J2010

crexport -Uusername –Ppassword -F"Y:\Reports\ SALES .rpt"
-O"C:\REPORTS\SALES.PDF"  -XFile –Epdf  -Sdatasource -N2 -A@YEAR -J2010  -N2 -A@PERIOD –J6

I would like to perform a similar task using SSRS

Thank you
Avatar of lcohan
Flag of Canada image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of OCUW



I was able to use the RS.exe program to export the reports

I used the code found here to create the  ExportReport.rss file

and then used modified it for my server and file paths,   and then using the following statment in a batch file I was able to pull and export my report.
rs -e Exec2005 -s http://localhost/reportserver -i "F:\RSS\ExportReport.rss" -v vFullPathOfOutputFile="F:\exported\CampaignStatus.pdf" -v vReportPath="/EnterpriseReports/Campaign Status" -v vFormat="PDF"

I did attempt to add a declared date to my output file name as a variable but haven't had any luck with that yet.

Thank you for your input,  it put me on the right track to accomplish this task.