user3758852
user3758852

Reputation: 11

how can i export radgridview to PDf in vb.net?

i am using RadGridView to showing detail now I want to Export this data to PDF format. I am working on VB.net . I have imported

Telerik.WinControls.UI, Telerik.WinControls.UI.Export, Telerik.WinControls.UI.Export.ExportToExcelML, Telerik.WinControls.Data

namespaces and I am using Dim pdfExporter As New Telerik.WinControls.Export.GridViewPdfExport(Me.grdTitles)

but it is not supporting

Please help me

Upvotes: 1

Views: 568

Answers (1)

Ggalla1779
Ggalla1779

Reputation: 476

There seems to be good Telerik documentation on using the PDF in VB and C#, there seems to be 2 options to export to PDF.

  • The GridViewPdfExport object utilizes the powerful RadPdfProcessing library and exports RadGridView`s data natively to the PDF format. (Recommended)

  • The ExportToPdf object on the other hand first renders RadGridView as an XHTML table and the export process will convert that table to a PDF document. That said, Export to PDF supports all of the ExportToHTML settings, but it also adds some PDF specific ones.

http://www.telerik.com/help/winforms/gridview-exporting-data-export-to-pdf.html

The GridViewPdfExport functionality is located in the TelerikExport.dll assembly. You need to include the following namespace in order to access the types contained in TelerikExport:

  • Telerik.WinControls.Export

Dim pdfExporter As New Telerik.WinControls.Export.GridViewPdfExport(Me.RadGridView1)

RunExport: Runs synchronously.

Dim fileName As String = "c:\ExportedData.pdf"   
pdfExporter.RunExport(fileName)

or RunExportAsync: Runs on a thread different than the UI thread.

Dim fileNameAsync As String = "c:\ExportedDataAsync.pdf"
pdfExporter.RunExportAsync(fileNameAsync)

Upvotes: 3

Related Questions