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.
Unfortunately, activation email could not send to your email. Please try again.

Export GridDataControl to PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

103612 May 16,2012 02:16 PM May 25,2012 08:42 AM WPF 1
loading
Tags: GridControl
Steven Paplanus
Asked On May 16, 2012 02:16 PM

 How would I export a griddata control to a pdf?


Steve


Rajasekar G [Syncfusion]
Replied On May 25, 2012 08:42 AM

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.

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.

;