问题
Having an issue with running reports here. I have a folder on the Report Server that contains several reports, reports are added and deleted on a weekly basis in this folder.
I know how to run a given report, but ideally what I'm looking for is running all the reports in the folder, is this possible?
Thank you in advance.
Mike
回答1:
This has different answers depending on whether you need to enter parameter values for any of these reports in order to run them.
If you don't, or if the parameter values are predictable (for example, every report takes a date range, but it's the same range for all of them, like the last 90 days), you could use the two SSRS web services.
For example, you could use the report management service (I believe it's called ReportingServices2005) to get the names of the reports in that folder, and the report execution service (ReportExecution2005) to provide parameters and execute each report. The report execution service can return you the report output in your choice of format (PDF, HTML, Excel, etc.)
Once you had the output of the report, you could direct it to a printer, save it to a file share, or email it as an attachment to whoever it needed to go to.
Here's a link to someone doing 90% of what you want to do: http://nickturner.wordpress.com/2010/03/31/creating-ssrs-report-as-a-pdf-programatically/
If every report needs a human to enter parameters, it comes down to making that easier for the human to do. The same idea of retrieving the names of the reports could apply, but then you'd display each report in turn in a ReportViewer
control, and once the report was run, change what report the ReportViewer
points to.
来源:https://stackoverflow.com/questions/22479871/can-i-run-all-the-reports-in-a-given-folder-from-report-server