ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Exporting Grid Data
In This Topic
    Exporting Grid Data
    In This Topic

    Grid data can be exported as a delimited text, Excel, HTML, PDF, or RTF file. The following table describes the methods used to export each file type:

    File Type Method Description
    All ExportTo Opens a dialog box in which the user can select the export format.
    Delimited Text ExportToDelimitedFile Exports the specified rows from the grid to the specified file as delimited text.
    Excel ExportToExcel Exports the grid to an Excel file.
    HTML ExportToHTML Exports the grid to an HTML file.
    PDF ExportToPDF Exports the grid to a PDF file.
    RTF ExportToRTF Exports the grid to an RTF file.
    Note: TrueDBGrid's export and printing features uses the C1.Win.Printing NuGet package, which provides three libraries: C1.PrintDocument, C1.Win.PrintPreview and C1.Win.RibbonPreview. Each library provides a set of previewing controls or components. The PrintDocument library provides the PrintDocument and MultiDocument components, the PrintPreview library provides the PreviewOutlineView, PreviewPane, PreviewTextSearchPanel, Thumbnail, PrintPreviewControl and PrintPreviewDialog components, and RibbonPreview  provides the RibbonPreview and RibbonPreviewDialog components. Since C1Report is now obsolete, make sure that the references for C1Report libraries is replaced by  individual library references in the C1.Win.Printing nuget.

    To set one the following export methods, add the appropriate code to the Click event of the Export button:


    See Also