在 ASP.NET MVC 2 应用程序中从 Sql Server 创建 pdf 报告?
我希望能够以某种方式从 MVC 应用程序中的 Sql Server 数据库中获取报告。我本可以开发一种方法来使用 xml 来做到这一点,然后将其转换为 fo 并通过 fo 处理器将其呈现为 pdf。但这需要能够在 Web 服务器上安装 fo 处理器,而我正在使用 Web 主机,所以这可能行不通。
所以我到处都看到了Reporting Services 的提及。这是否包括创建 pdf 的可能性?如果是这样,如何在 MVC 应用程序中使用它?我之前尝试过将 Web 表单混合到 MVC 应用程序中(如果这是必要的,正如我所看到的暗示的那样),但无法使其工作。路由似乎无法识别 Web 表单页面...
或者是否有其他更简单的方法从 Sql Server 数据创建 pdf 报告?我还应该提到,我只使用 Linq (和实体框架)来访问数据,因此希望有一个解决方案不需要我了解 Sql 存储过程等...
任何帮助表示赞赏!
I want to be able to somehow get reports out of my Sql Server database in an MVC application. I could have developed a way to do that using xml and then transform it to fo and rendered it via an fo processor to pdf. But that would require being able to have the fo processor installed on the web server, and I'm using a web host, so that's probably not going to work.
So I've seen Reporting Services mentioned here and there. Does that include the possibility to create pdfs? And if so, how do you use it in an MVC application? I tried before to mix webforms into MVC application (if that's necessary as I've seen implied) but couldn't make it work. The routing didn't seem to recognize the web form page...
Or is there any other easier way to create pdf reports from Sql Server data? I should also mention that I only use Linq (and the Entity Framework) to access data, so hopefully there is a solution that doesn't require me to know Sql stored procedures etc...
Any help appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 http://sourceforge.net/projects/itextsharp/ iText 的 ac# 端口用于 PDF 生成的开源 Java 库。使用这些库创建简单的 PDF 相对简单
Take a look at http://sourceforge.net/projects/itextsharp/ a c# port of the iText open source java library for PDF generation. It is relatively straightforward to create simple PDFs using these libraries