简体   繁体   English

如何在没有SSRS服务器的情况下使用Report Viewer控件执行.rdl报告?

[英]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. 我正在尝试设置一个网页,用户可以在其中选择要运行的.rdl文件,它将打开报表查看器控件(ASPX),加载报表定义文件,运行它并显示报表。

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. 到目前为止,我发现,“本地”报告只能接受来自代码的数据源(因此您必须手动执行数据库代码,这将是一个痛苦,因为数据源可能在报告之间变化很大)和“远程” “报告需要SSRS服务器,我无法设置。

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? 让我感到困惑的是,Report Builder 3能够运行带有嵌入式数据源的.rdl文件,那么为什么Report Viewer不能控制呢? Is there some way I can make the Report Viewer control act like Report Builder 3 and just have it run .rdl files? 有没有什么方法可以让Report Viewer控件像Report Builder 3一样运行并运行.rdl文件?

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. 报告查看器可以运行RDL文件,但它们需要先托管/发布,然后报告查看器处于远程模式。 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?". ReportView具有可以运行的不同模式,其中一个基本上只是与SSRS服务器通话并说:“你在那里得到了什么?”。 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. 您可以使用“高级选项”开发一个常规SSRS服务器,以便在需要考虑成本的情况下在框中获取SSRS实例并相应地调整防火墙。 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. 老实说,如果你想对实体框架或WCF服务这样的东西进行更多的耦合控制,并且想要在将数据放到报告之前按摩你的数据,我会去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. 如果要创建包含大型数据集的报表,并为用户提供许多选项来更改报表布局和参数值,我会转到rdl,但是知道您需要设置SSRS实例。 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. 尝试在没有服务器的情况下设置RDL报告,然后运行它们是一个巨大的痛苦,不会让你感到痛苦。 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. 如果是您想要的参数,您可以创建自己的参数,然后在数据进入RDLC的数据源之前按摩数据,然后将RDLC呈现给最终用户。 This method involves reading more of the MS whitepaper on the reporting language and understanding how to implement the RDLC object in code behind. 此方法涉及阅读有关报告语言的更多MS白皮书,并了解如何在代码后面实现RDLC对象。

More of the eternal argument of RDL versus RDLC here: When to use RDLC over RDL reports? 这里有更多关于RDL与RDLC的永恒论点: 何时使用RDLC而不是RDL报告?

No, you will need an SSRS Server to do what you are trying to do, unless you use RDLC files. 不,除非您使用RDLC文件,否则您将需要SSRS服务器来执行您要执行的操作。 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. 您可以获得非常有创意并自己解析数据源的RDL xml并执行操作,但这基本上与RDLC做同样的事情。

Here is a link to an MSDN article that will provide some information about using the WebForms ReportViewer control: 以下是MSDN文章的链接,该文章将提供有关使用WebForms ReportViewer控件的一些信息:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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