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

拈花ヽ惹草 提交于 2019-12-10 18:56:46

问题


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?


回答1:


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?




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/17621346/how-can-i-execute-an-rdl-report-with-a-report-viewer-control-without-an-ssrs-se

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!