Tuesday, 20 September 2005

Running Reporting Services Script from Visual Studio

Been playing around with Reporting services scripting a bit lately.
The one gaping flaw with the Report Project in Visual Studio is that it doesn't support multiple levels of folders. So if you have Report Manager organised with reports in different folders depending on the Department/Run Time/Category/etc... you'll to choose from some not so nice options,
1) For each folder in Report Manager that holds reports, create a corresponding Report Project in Visual Studio.
2) Create one Report Project in Visual Studio and after deployment use Report Manager to move the reports to the appropriate folder.

For some time I was thinking that the second option was pretty cool. I had a nice simple Report Project. All my datasources and report resources were located in one spot. However, now that I'm deploying and re-deploying reports on a day-to-day basis I've discovered that even this is a real drag.

So then I started looking into deploying the reports via script, it kinda works at the moment, but still needs some bugs ironed out. (I'll post it when it's ready). Then came the hassle of jumping from Visual Studio to the command prompt and back again. Trying to remember the correct syntax for the parameters, etc... It was quickly after this that I discovered the 'External Tools...' option in Visual Studio. Turned out to be a very, very simple to setup and is a joy to behold ;-)

Choose 'External Tools...' from the 'Tools' menu in Visual Studio then follow through the steps,
1. Click Add to create a new entry
2. Give it a name you'll recognise
3. Browse to the location of the RS.EXE application
4. Use the arguments to add the ItemPath for the -i parameter and include the URL for your Report Server for the -s parameter
5. Set the initial directory to the project directory, or whichever directory you choose.
6. Personally I keep the check box option off, but try the different options and see which works best for you.

Once everything has been setup click 'Apply' and you'll have a new option on the 'Tools' menu.
I have the RSS file included in my Reports solution under Miscellaneous files. When I want to deploy the reports I open the RSS file and choose the run the script via the newly menu option.

No comments: