问题
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.
回答1:
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.
回答2:
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)
来源:https://stackoverflow.com/questions/3591322/generating-reports-using-custom-data-html-table-not-dataset