简体   繁体   中英

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

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?

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?

No, you will need an SSRS Server to do what you are trying to do, unless you use RDLC files. You could get very creative and parse the RDL xml for the datasources yourself and perform the actions, but that is basically doing the same thing as RDLC.

Here is a link to an MSDN article that will provide some information about using the WebForms ReportViewer control:

http://technet.microsoft.com/en-us/library/aa337091(v=sql.100).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM