Skip to main content
All docs
V24.2

Print and Export

  • 2 minutes to read

You can render WinForms Vertical Grid content to paper like a traditional WYSIWYG report or export data to numerous file formats. With its API, you can save your data as PDF, XLS, XLSX, MHT, HTML, RTF, DOCX, TXT.

Print and Export - WinForms Vertical Grid

Note

The Vertical Grid can be printed, exported, and previewed only if the DevExpress Printing Library is available. The Printing Library ships as part of the DevExpress WinForms Subscription.

Use the IsPrintingAvailable property to check whether the Vertical Grid can be printed.

Use the VGridControl.OptionsPrint.PrintRecordHeaders property to specify whether to print or export record headers.

API Name Description
Print() Prints the vertical grid control.
ShowPrintPreview() Opens the Print Preview window with a traditional toolbar UI.
ShowRibbonPrintPreview() Opens the Print Preview window with a Ribbon UI.
IsPrintingAvailable Indicates whether the Vertical Grid can be printed.

The following example demonstrates how to open the Print Preview window:

if(vGridControl1.IsPrintingAvailable)
    vGridControl1.ShowRibbonPrintPreview();

Export API

API Name Description
Export Exports data in the specified format.
ExportToHtml Exports data as HTML.
ExportToPdf Exports data as PDF.
ExportToRtf Exports data in RTF format.
ExportToDocx Exports data in the Office Open XML file format (DOCX).
ExportToText Exports data as text.
ExportToXls Exports data in XLS format.
ExportToXlsx Exports data in XLSX (MS Excel 2007) format
ExportToMht Exports data in MHT format.

The following example demonstrates how to export data in PDF format and save it to a file:

if(vGridControl1.IsPrintingAvailable)
    vGridControl1.ExportToPdf(@"d://verticalgrid.pdf");
See Also