none
Generating PDF file from DataSet or DataGridView in windows form application in c#

    Question

  • Hello,

    I have an application in C sharp which displays Some records to the user using DataGridView.

    I have created a DataSet in which I am storing all the records and then binding this DataSet to the dataGridView.

    When user closes an application I want to generate a PDF file which contains all the records those are displayed to the user.

    Is it possible to generate a PDF file by using DataSet and without using Crystal reports? My record contains images too.

    Help is needed as early as possible.

    Thank you!

    Tuesday, April 19, 2011 10:44 AM

Answers

  • Hi AnujaKJ,

    Based on your description, do you mean you want to export data form dataset or datagridview to PDF file?

    If so, there are many ways can chieve that:

    1.Using Reporting Services report generation: http://www.codeproject.com/KB/reporting-services/ReportExporters_WinForms.aspx
    2.Using ReportViewer.Drop a Table report item on an RDLC report, populate it with data and it can be exported to PDF or Excel.
    3.Using a free tool.See CompletIT DataGridView Extension on http://www.completit.com/Products/DGVE/Overview.aspx

    I am not sure whether it can achieve by Crystal Reports. If you want to use Crustal Report, you can go to the Crystal Reports for Visual Studio Forum for help. Thanks.

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Vin Jin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Aspen VJ Thursday, April 28, 2011 7:12 AM
    Thursday, April 21, 2011 8:52 AM

All replies

  • Hi AnujaKJ,

    Based on your description, do you mean you want to export data form dataset or datagridview to PDF file?

    If so, there are many ways can chieve that:

    1.Using Reporting Services report generation: http://www.codeproject.com/KB/reporting-services/ReportExporters_WinForms.aspx
    2.Using ReportViewer.Drop a Table report item on an RDLC report, populate it with data and it can be exported to PDF or Excel.
    3.Using a free tool.See CompletIT DataGridView Extension on http://www.completit.com/Products/DGVE/Overview.aspx

    I am not sure whether it can achieve by Crystal Reports. If you want to use Crustal Report, you can go to the Crystal Reports for Visual Studio Forum for help. Thanks.

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Vin Jin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Aspen VJ Thursday, April 28, 2011 7:12 AM
    Thursday, April 21, 2011 8:52 AM
  • You might try to mail merge Word from C# using the DataSet or DataTable as a data source to import its data to the document and then create PDF in C# out of the mail merged document like this:

    // Load a document.
    var document = DocumentModel.Load("TemplateDocument.docx", LoadOptions.DocxDefault);
    
    // Execute mail merge.
    document.MailMerge.Execute(dataSet);
    
    // Save the document to a PDF file.
    document.Save("Document.pdf");

    Tuesday, July 24, 2012 8:05 AM