Class GridExcelExport
This class exports the PivotGrid content to Excel document with the applied style.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.PivotGrid.Converter
Assembly: Syncfusion.PivotGridConverter.Wpf.dll
Syntax
public class GridExcelExport : IDisposable
Constructors
GridExcelExport(PivotGridControl)
Initializes a new instance of the GridExcelExport class.
Declaration
public GridExcelExport(PivotGridControl gridControl)
Parameters
Type | Name | Description |
---|---|---|
PivotGridControl | gridControl | This parameter holds PivotGrid control object which is utilized for Excel exporting. |
GridExcelExport(PivotGridControl, ExportModes)
Initializes a new instance of the GridExcelExport class.
Declaration
public GridExcelExport(PivotGridControl gridControl, ExportModes mode)
Parameters
Type | Name | Description |
---|---|---|
PivotGridControl | gridControl | This parameter holds PivotGrid control object which is utilized for Excel exporting. |
ExportModes | mode | Option to export PivotGrid either in Cell mode or PivotTable mode. |
GridExcelExport(PivotGridControl, ExcelVersion)
Initializes a new instance of the GridExcelExport class.
Declaration
public GridExcelExport(PivotGridControl gridControl, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
PivotGridControl | gridControl | This parameter holds PivotGrid control object which is utilized for Excel exporting. |
ExcelVersion | version | Excel Version. |
GridExcelExport(PivotGridControl, ExcelVersion, ExportModes)
Initializes a new instance of the GridExcelExport class.
Declaration
public GridExcelExport(PivotGridControl gridControl, ExcelVersion version, ExportModes mode)
Parameters
Type | Name | Description |
---|---|---|
PivotGridControl | gridControl | This parameter holds PivotGrid control object which is utilized for Excel exporting. |
ExcelVersion | version | Excel Version. |
ExportModes | mode | Option to export PivotGrid either in Cell mode or PivotTable mode. |
GridExcelExport(PivotGridControl[], ExcelVersion, ExportModes)
Initializes a new instance of the GridExcelExport class.
Declaration
public GridExcelExport(PivotGridControl[] gridControls, ExcelVersion version, ExportModes mode)
Parameters
Type | Name | Description |
---|---|---|
PivotGridControl[] | gridControls | This parameter holds PivotGrid control object which is utilized for Excel exporting. |
ExcelVersion | version | Excel Version. |
ExportModes | mode | Option to export PivotGrid either in Cell mode or PivotTable mode. |
Properties
application
This property is used to instantiate various kinds of applications.
Declaration
public IApplication application { get; set; }
Property Value
Type |
---|
IApplication |
excelEngine
Create instance for Excel Engine.
Declaration
public ExcelEngine excelEngine { get; set; }
Property Value
Type |
---|
ExcelEngine |
ExportMode
Gets or sets the mode(Cell/PivotTable) to export.
Declaration
public ExportModes ExportMode { get; set; }
Property Value
Type | Description |
---|---|
ExportModes | ExportMode |
GridControl
Gets the PivotGrid control to export its content to Excel.
Declaration
public PivotGridControl GridControl { get; }
Property Value
Type |
---|
PivotGridControl |
sheet
Declare sheets to be added in Workbook.
Declaration
public IWorksheet sheet { get; set; }
Property Value
Type |
---|
IWorksheet |
ShowDisplayItemsOnly
Gets or sets whether the PivotSchemaDesigner in Excel Sheet can show all the items or only the displayed items.
Declaration
public bool ShowDisplayItemsOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowRowColumnHeaders
Show/hide the PivotGrid row and column header, in the exported Excel document, when the export mode is set to "Cell".
Declaration
public bool ShowRowColumnHeaders { get; set; }
Property Value
Type |
---|
System.Boolean |
workBook
Declare Workbook to be added in Excel file.
Declaration
public IWorkbook workBook { get; set; }
Property Value
Type |
---|
IWorkbook |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Export(String)
Exports the PivotGrid content into Excel using different export modes like Cell/PivotTable with the specified file name.
Declaration
public void Export(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Provides specific file name to the exported Excel document. |
Export(String, Boolean)
Exports the PivotGrid content into Excel using different export modes like Cell/PivotTable with the specified file name.
Declaration
public void Export(string fileName, bool ignoreStyles)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Provides specific file name to the exported Excel document. |
System.Boolean | ignoreStyles | Provides whether the cell styles can be ignored from exporting. |
Remarks
When exporting the PivotGrid control with huge amount of rows and columns, Call this method with passing the "ignoreStyles" is true. Then the exporting will be done quickly.
RaiseCurrentCellExported(ExportingToExcelEventArgs)
Raises the event when the templated cell is exported to Excel sheet.
Declaration
public void RaiseCurrentCellExported(ExportingToExcelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ExportingToExcelEventArgs | e |
RaiseUpdateDataSourceForCustomSummaries(DataSourceUpdateEventArgs)
Raises the UpdateDataSource event when custom summary column is exported to Excel sheet.
Declaration
public void RaiseUpdateDataSourceForCustomSummaries(DataSourceUpdateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataSourceUpdateEventArgs | e | An event parameter. |
Events
QueryExportCellInfo
Event to handle the Grid cell while exporting.
Declaration
public event QueryExportCellInfoEventHandler QueryExportCellInfo
Event Type
UpdateDataSource
Event to handle the DataSource change when custom summary is used.
Declaration
public event UpdateDataSourceEventHandler UpdateDataSource