A newer version of this page is available.
Switch to the current version.
XlsxExportOptionsEx.BeforeExportTable Event
Allows you to customize a native Excel table's settings before export. This event is in effect when the XlsxExportOptionsEx.LayoutMode property is set to Table.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v18.2.Core.dll
Declaration
public event BeforeExportTable BeforeExportTable
Public Event BeforeExportTable As BeforeExportTable
Examples
The following example shows how to change the style of the native Excel table to which data is exported from a grid control.
using DevExpress.Export.Xl;
using DevExpress.XtraPrinting;
string path = "gridNative.xlsx";
XlsxExportOptionsEx options = new XlsxExportOptionsEx();
options.LayoutMode = DevExpress.Export.LayoutMode.Table;
options.BeforeExportTable += ea => {
ea.Table.Style.Name = XlBuiltInTableStyleId.Medium1;
};
gridControl1.ExportToXlsx(path, options);
Implements
DevExpress.Export.IDataAwareExportOptions.BeforeExportTable
See Also
Feedback