locked
ASP.Net Convert DataTable to PDF Question RRS feed

  • 問題

  • Hi

    I am wondering if there any easy to use (FREE) PDF library that I can use to convert a DataTable to a PDF file and allow user to download the PDF file?

    I used to use Gio PDF .Net Library (from the link below)
    http://www.codeproject.com/KB/graphics/giospdfnetlibrary.aspx

    I am not sure why I keep receiving "Error Generating Document" on my ASP.Net Application but not on my VB.net Application. It just work fine on my VB.Net.

    Thanks in advance.
    2008年6月12日 上午 10:16

解答

  • I do not have experience on the Gio PDF library so I may not be able to answer your question, however, by searching sourceforge.net I found a few .NET opensource PDF generating library. I took a brief look and some of them seems to be quite easy to use. I am listing them for your reference:

    http://report.sourceforge.net/
    http://sourceforge.net/projects/npdf/
    http://sourceforge.net/projects/itextsharp/
    2008年6月13日 上午 06:26

所有回覆

  • I do not have experience on the Gio PDF library so I may not be able to answer your question, however, by searching sourceforge.net I found a few .NET opensource PDF generating library. I took a brief look and some of them seems to be quite easy to use. I am listing them for your reference:

    http://report.sourceforge.net/
    http://sourceforge.net/projects/npdf/
    http://sourceforge.net/projects/itextsharp/
    2008年6月13日 上午 06:26
  • Hi Jack

    Thanks for your information, I searched for it on Google as well. GIO PDF is quite easy to use [E.G. you can pass the DataTable object into there, and it will generate the table on PDF], for ITextSharp, i think you need to write your own method to convert the datatable to PDF, E.G. work out the nested loop to build the table on PDF or something.

    I will try out another 2 and let you know how I getting on later.

    I found that seems quite good, unfortunately, I could not find any example code for it, so need to spend sometime to work out how to do it.

    Thanks very much for your help.
    2008年6月13日 上午 07:22
  • Hi Chi,

     

    If you want to read more about iText (or iTextSharp), there are lots of online articles about this product, and I remember there is a book specifically on this topic as well: http://www.manning.com/lowagie/

     

    Regards,

    Colt

    2008年6月14日 下午 03:51
  • Hi Colt,

    Thanks for your information, Do you have any library that you recommend to convert datatable to PDF by using ASP.net? I need to build a feature to allow user to export data from DataTable to grid view. My collegue use ITextSharp to build the PDF, unfortunately, the way he did it is quite long winded, and only for one DataTable, if you want to export another table, you need to build another method to do it. Therefore, i think it probably take me quite a quite to do all of them, so I would like to know if there any DataTable to PDF Library for ASP.NET.

    When I have time i probably will  to learn iTextSharp properly.

    Thanks again.
    2008年6月14日 下午 04:39
  • 2008年10月29日 上午 02:06
  • i can not create PDF from datatable using Itextsharp, plz help.
    2008年11月14日 下午 07:29