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

sfDataGrid to pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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

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

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;