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.

sfDataGrid to pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

116475 May 31,2014 12:14 PM Jun 5,2014 07:33 AM WinRT 1
loading
Tags: SfDataGrid
Faysal Ahmed
Asked On May 31, 2014 12:14 PM

Is there any method where I can directly pass the sfDatagrid to generate a pdf file.?

Jayapradha S [Syncfusion]
Replied On June 5, 2014 07:33 AM

Hi Faysal,

 

Thank you for contacting Syncfusion Support.

 

Yes , it is possible to generate grid to pdf file by using ExportToPdf() method as shown in the following code snippet:

 

Code Snippet:

 

  PdfDocument document = new PdfDocument();

  document = datagrid.ExportToPdf();

  var savePicker = new FileSavePicker { SuggestedFileName = "file1", SuggestedStartLocation = PickerLocationId.Desktop };

 savePicker.FileTypeChoices.Add("Pdf Files(.pdf)", new List<string>() { ".pdf" });

  var storageFile =await savePicker.PickSaveFileAsync();

  if (storageFile != null)

 await document.SaveAsync(storageFile);

 

Please let us know if this solution helps you.

 

Regards,

Jayapradha S


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.

;