Codenivore
Codenivore

Reputation: 23

Using SSRS and SSIS to automate Excel output c#

I am looking for some c# code which I can put into a script task in SSIS which will run an SSRS report. I do not wish to deploy or publish my SSRS report. I just want to be able to call the rdl and run it and for an excel output to be produced.

This could be done in SSIS and put into Excel but SSRS has more formatting and prettying up capability.

Can anyone help me ... or point me in a good direction at all? I have searched the net and it seems there is an extension available by zappy but this wouldn't be feasible as I am on a work computer.

Upvotes: 2

Views: 749

Answers (1)

StevenWhite
StevenWhite

Reputation: 6024

The .rdl is just a report definition, it doesn't have any exporting capabilities. That is all handled by the reporting services. In order to do what you're asking, you'd have to tap into those services and replicate what tools like Visual Studio do behind the scenes. As you discovered, there's no documentation or precedent for that.

What I would recommend is to deploy a copy of the report to a report server, but set it to be hidden. This way, only report server admins would be able to see it. Next, set up a subscription to have the report export to a specific location. Behind the scenes, this creates a SQL Server job that you can trigger from your C# code. So you would call the job, wait for it to finish, and then use the output it generated.

Without using the report server, you'd have to have a manual step to run the report in Report Builder or Visual Studio. You can do a lot of Excel formatting through C#, but it is admittedly more difficult than using a visual interface. And if you have a large dataset, it can be really slow to format cell-by-agonizing-cell.

Welcome to Stack Overflow and I hope this helps.

Upvotes: 2

Related Questions