We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export GridDataControl to PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

103612 May 16,2012 06:16 PM UTC May 25,2012 12:42 PM UTC WPF 1
loading
Tags: GridControl
Steven Paplanus
Asked On May 16, 2012 06:16 PM UTC

 How would I export a griddata control to a pdf?


Steve


Rajasekar G [Syncfusion]
Replied On May 25, 2012 12:42 PM UTC

Hi Steven,

 

Thanks for your update .

 

You can achieve your requirement by using the following code snippet.

 

Code Snippet:

SaveFileDialog sfd = new SaveFileDialog

        {

            DefaultExt = ".pdf",

            Filter = "Adobe PDF Files(*.pdf)|*.pdf",

            FilterIndex = 1,

            RestoreDirectory = true

        };

        PdfDocument document;

        if (sfd.ShowDialog() == true)

        {

            using (Stream stream = sfd.OpenFile())

            {

                document = this.dataGrid.Model.ExportToPdfGridDocument(GridRangeInfo.Table());

                document.Save(stream);

                Process.Start(sfd.FileName);

            }

        }

 

 

we have created a sample application using this and it can be downloaded from the below location.

 

Sample location: ExportToPDF.zip

 

Please let us know if you have any questions.

 

Thanks,

Raja sekar.G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;