简体   繁体   English

MSFT报告查看器(rdlc)是否可以与MVC一起使用

[英]Would the MSFT Report Viewer (rdlc) Work with MVC

I am interested in learning MVC, and have experimented with a couple of the sample apps. 我有兴趣学习MVC,并尝试过几个示例应用程序。 As a project, I'd like to move part or all of my own office app to MVC. 作为一个项目,我想把我自己办公室应用程序的部分或全部移动到MVC。 An important part of this app, and of ALL of my apps for customers, is the printing of invoices, purchase orders, inventory lists and so forth. 此应用程序以及我的所有客户应用程序的一个重要部分是打印发票,采购订单,库存清单等。 In fact, one of their main criteria for judging what we do is the appearance of these documents and their incorporation into the app in a practical, intuitive way. 事实上,他们判断我们所做工作的主要标准之一是这些文件的外观以及它们以实用,直观的方式融入应用程序。

It's impossible for me to get by without a report writer. 没有报告撰稿人,我就不可能顺利过关。 The MSFT report viewer used to produce rdlc reports has been sufficient, and even comes up better than the competition in a couple of key areas. 用于生成rdlc报告的MSFT报告查看器已足够,甚至比几个关键领域的竞争对手更好。

Does this control work with an ASP.NET MVC application? 此控件是否适用于ASP.NET MVC应用程序?

"ASP.NET ViewState has been disabled. The Report Viewer control requires that ViewState be enabled." “ASP.NET ViewState已被禁用。报表查看器控件要求启用ViewState。” if you run the report viewer from a view. 如果从视图中运行报表查看器。

But you can run a webforms page in the same project. 但是您可以在同一个项目中运行webforms页面。 Ugly, but it works. 丑陋,但它的工作原理。

And you could try this too: http://weblogs.asp.net/rajbk/archive/2006/03/02/How-to-render-client-report-definition-files-_28002E00_rdlc_2900_-directly-to-the-Response-stream-without-preview.aspx 您也可以尝试这样做: http//weblogs.asp.net/rajbk/archive/2006/03/02/How-to-render-client-report-definition-files-_28002E00_rdlc_2900_-directly-to-the-Response -stream-没有-preview.aspx

Assume controls don't work until you can prove otherwise. 假设控制工作,直到你可以证明他。

In MVC, there is no server-side form, no post back, no view state. 在MVC中,没有服务器端表单,没有回发,没有视图状态。 If the control relies on any of these things -- and most do -- then it won't work properly in MVC. 如果控件依赖于任何这些东西 - 而且大多数都是 - 那么它在MVC中将无法正常工作。

I don't see any reason why is won't work. 我认为没有任何理由不起作用。 ASP.Net work the same way is it you were using Web Forms. ASP.Net的工作方式与使用Web窗体的方式相同。 The only thing you don't get is the Postback, which I don't think is necessary if you are just rendering a report in your page. 你唯一没有得到的是Postback,如果你只是在你的页面中呈现一个报告,我认为这是不必要的。

如果您在项目中专门使用MVC,请查看使用SRS Web服务呈现报告。

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

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