views:

109

answers:

2

Hi, I've like to be able to run reports from a console application.

The reason I need to do this is because we have a single template with a few params and many reports running off that template - each providing different arguments. It is easier for us to schedule a console app and have the report arguments read from a database.

How can I run reports dynamically from a console app?

Also - is there a way to have the reports output straight to a file share from the command line?

And finally - if the above is possible then is there a way to control the name of the files that are generated and stored in the file share.

Many thanks for any pointers you can provide.

A: 

You'll want to make a call to your reporting services instance from your app to run the report and export to some document type, say pdf.

You'll need to add a reference to your RS web service and look into the ReportingServices class. http://msdn.microsoft.com/en-us/library/reportservice2005.reportingservice2005_members.aspx

Output to a specified location can be given as a parameter to you RS call.

JohnnyH
+1  A: 

SSRS ships with an application called rs.exe which permits you to execute operations scripted in VB.Net against the reporting server.

If that doesn't meet your needs, you can access SSRS via the web service from your own .net code, using the ReportExecution2005 namespace.

Alternatively, you could try constructing URL parameter strings with the options you need and fetching them with a generic command line tool like wget - but this is probably the least robust option of the three.

Ed Harper
Hi. Thanks for this information. This got me heading in the necessary direction. In the end I used the ReportExecution2005 service. I exposed this from my own wcf service and called that from a powershell script.
Peanut