ChartControl.ExportToXls(String, XlsExportOptions) Method
Creates an XLS file with a chart inserted as an image, with the specified options.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.UI.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
filePath | String | A String specifying the full path (including the file name and extension) where the XLS file will be created. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
options | XlsExportOptions | null | An XlsExportOptions object, containing the options for the resulting XLS file. |
Remarks
If a file under the specified file path exists, the new file replaces it.
To show the standard Print dialog, use the ChartControl.Print method. The dialog allows end-users to print the chart, select the printer (if required), specify the range of pages to print, the number of copies, etc.
To display the DevExpress Print Preview use one of the following methods.
Method | Description |
---|---|
ChartControl.ShowPrintPreview | Creates the print document and displays the Print Preview of the document. |
ChartControl.ShowRibbonPrintPreview | Creates the print document and displays the Print Preview with the Ribbon toolbar of the document. |
To export the chart, use the appropriate ExportTo~ method (e.g., ChartControl.ExportToHtml, ChartControl.ExportToPdf, etc.)
Important
Note that, exporting to raster and vector images is implemented by the Chart and does not require any library.
The chart can be previewed, printed and exported to other formats only if the Printing library is available. Make sure you add a reference to the DevExpress.XtraPrinting.v24.2 assembly.
Also note that chart export to PDF requires the DevExpress.Pdf.Core library to be available.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ExportToXls(String, XlsExportOptions) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.