PivotGridControl.ExportToHtml(String) Method
Exports the Pivot Grid Control’s data to the specified file as HTML.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.1.dll
NuGet Package: DevExpress.Win.PivotGrid
Declaration
Parameters
Name | Type | Description |
---|---|---|
filePath | String | A String containing the full path (including the file name and extension) specifying where the HTML file will be created. |
Remarks
This method overwrites any files present at the specified path that have the same name without warning. Note that the .html (or an appropriate) extension has to be specified in the path.
To decrease the size of the created HTML file (remove secondary symbols), use the ExportToHtml method with the compressed parameter set to true.
Note: the Pivot Grid Control’s data can only be exported if the XtraPrinting Library is available. Use the PivotGridControl.IsPrintingAvailable property to check whether the grid’s data can be exported.
Example
The following example demonstrates how to export the Pivot Grid Control’s data to HTML documents using Unicode (UTF-8) and Western European (ISO) encodings. The encoding name is passed via the htmlCharSet parameter.
// Exports to an HTML file using the UTF-8 Unicode encoding.
pivotGridControl1.ExportToHtml("OutputUnicode.html", "utf-8",
"Unicode UTF-8 Example", false);
// Exports to an HTML file using the Western European ISO encoding.
pivotGridControl1.ExportToHtml("OutputIso.html", "iso-8859-1",
"Western European ISO Example", true);