使用自定义数据(html 表)而不是数据集生成报告
我在这个网站上阅读了几篇文章,还有许多其他文章推荐各种类型的报告生成工具,但都使用数据集作为数据源。
这不是我的要求!
我需要某种方法来导出 mypage.aspx 上的 htmltable 中显示的数据。
- 用户点击查看记录
- 打开的pdf(它应该包含动态制作的html表的数据)
我想使用htmltable作为数据源动态生成pdf并在浏览器中显示它aa pdf doc 但不必将结果保存到网络服务器。
I read several articles on this site and many others recommending report generating tools of various kinds but all use dataset as there datasource.
This is not my requirement!
I need some way to export the data which is displayed in the htmltable on mypage.aspx.
- user clicks view record
- a pdf opens (it should contain the data of the html table which is made dynamically)
I want to generate a pdf on the fly using a htmltable as a source of data and displaying it a a pdf doc in the browser but not having to save the result to the webserver.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以查看iTextSharp,这里有一个教程,了解如何开始。文档中还有一个部分,说明了如何在PDF 文档。
You may take a look at iTextSharp and here's a tutorial on how to get started. There's also a section in the documentation which illustrates how to create tables in PDF documents.
查看有关 abcPDF 的帖子。您所描述的内容与我使用他们的库的用途非常相似。当我最初测试各种方法时,我尝试过 iTextSharp 但发现成本非常低, abcPDF 用最少的代码行完成了我需要的一切(特别是 HTML 到 PDF 生成) 。
从 HTML 生成 PDF(.NET 组件)
Check out this thread regarding abcPDF. What you are describing is very similar to what I have used their library for. When I was originally testing out various methods, I had tried iTextSharp but found for the very minimal cost, abcPDF did everything that I required (sepcifically HTML to PDF generation) with minimal lines of code.
Generation PDF from HTML (component for .NET)