We have a requirement to export different pages of our I.E. only web application to Excel/pdf documents. The pages have graphics/grids/text, etc...They should also be printable as well. I heard weSuperGoo mentioned, but have no experience with it. I am in the research phase now and I wonder what tools/technologies/methods are out there for this task? I would appreciate any pointers/direction.


+1  A: 

To export to Excel, you can simply just export a HTML table as HTML and name the file whatever.xls. Excel will automatically convert the HTML table to a spreadsheet. I've been using that trick for many, many years. If you're using something like a DataGrid, then that makes it even easier to just write out the contents of the control to a HTML file (or string) and then return it as a .xls file.

For PDF, I recommend iTextSharp. It's really easy to use and has worked well for me for many years. You can use the iText (Java version) documentation or the iTextSharp documentation, the methods and classes are the same (maybe capitalization is different, but you should be able to figure it out.)


Jim W
I've been using the same trick for xls too. Thanks for the iTextSharp link - I'm looking to do the same thing for PDF
+2  A: 

We have used ABCpdf by WebSupergoo which includes the ability to retrieve a URL and convert it to a PDF (see documentation). This means all we need to do is provide a suitably formatted version of the page in plain old HTML and point ABCpdf at this URL and it will convert everything automatically for us - beats having to build the page up manually element by element.

I should add that this isn't perfect - we have had some issues relating to matters like paging (very difficult to page HTML when you need things like headers and footers on every page) but for simple uses it's up to the job.

You can get ABCpdf free if you're prepared to link to them.

Luke Bennett