How can I execute an .rdl report with a Report Viewer control without an SSRS server?

qJake picture qJake · Jul 12, 2013 · Viewed 28.1k times · Source

I'm trying to set up a web page where users can select an .rdl file to run, and it will open a Report Viewer control (ASPX), load the report definition file, run it, and display the report.

So far, what I've found is, "local" reports can only accept data sources from code (so you have to execute the database code manually, which would be a pain since the datasource can vary widely between reports), and "remote" reports require an SSRS server, something I am unable to set up.

What puzzles me is, Report Builder 3 is able to run .rdl files with embedded Data Sources in them, so why can't the Report Viewer control? Is there some way I can make the Report Viewer control act like Report Builder 3 and just have it run .rdl files?

Answer

djangojazz picture djangojazz · Jul 12, 2013

The Report Viewer CAN run RDL files but they need to be hosted/published somewhere first is the rub then the reportviewer is in remote mode. The ReportView has different modes it can run in and one of them is basically just talking to the SSRS server and saying: "What you got up there?". There are a great great many debates of when to the local reports or the hosted ones and what are advantages/disadvantages of one over the other. You can develop just a regular SSRS Server with 'advanced options' to get the SSRS instance on a box if costs are a concern and adjust firewalls accordingly. If it is a policy setting I can't help with that.

Honestly if you want more coupled control to something like Entity Framework or WCF service and want to massage your data BEFORE you put it to a report, I would go RDLC. If you want to create a report with large datasets and give the user lots of options to alter the report layout and values from parameters I would go rdl but know you need to set up an SSRS instance. To try to set up RDL reports WITHOUT the server and then run them is a big pain that does not get you much but heartache. If it is the parameters you are wanting you can create your own, then massage the data BEFORE it goes to the datasource of the RDLC, then present the RDLC to an end user. This method involves reading more of the MS whitepaper on the reporting language and understanding how to implement the RDLC object in code behind.

More of the eternal argument of RDL versus RDLC here: When to use RDLC over RDL reports?