corelibraries-devexpress-dot-xtraprinting-dot-printingsystembase-2b6786d4.md
Occurs after creation of an XLS or XLSX document worksheet has finished.
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
public event XlSheetCreatedEventHandler XlSheetCreated
Public Event XlSheetCreated As XlSheetCreatedEventHandler
The XlSheetCreated event's data class is XlSheetCreatedEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Index | Specifies the Excel sheet index number. |
| SheetName | Specifies the Excel sheet name. |
When you export to different worksheets (XlsxExportMode.SingleFilePageByPage mode), handle this event to name a worksheet in the exported file based on the page number. For this, set the XlSheetCreatedEventArgs.SheetName to a string composed of the XlSheetCreatedEventArgs.Index value.
The XlSheetCreated event is not raised when a document is exported to a single file (the XlsExportOptions.ExportMode or XlsxExportOptions.ExportMode option is set to SingleFile ).
The following code snippets (auto-collected from DevExpress Examples) contain references to the XlSheetCreated event.
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.
InitializeComponent();
this.PrintingSystem.XlSheetCreated += PrintingSystem_XlSheetCreated;
this.PrintingSystem.AddService(typeof(CustomPageDataService), new CustomPageDataService(pageAdditionalData));
InitializeComponent();
this.PrintingSystem.XlSheetCreated += PrintingSystem_XlSheetCreated;
this.PrintingSystem.AddService(typeof(CustomPageDataService), new CustomPageDataService(pageAdditionalData));
InitializeComponent()
AddHandler PrintingSystem.XlSheetCreated, AddressOf PrintingSystem_XlSheetCreated
Me.PrintingSystem.AddService(GetType(CustomPageDataService), New CustomPageDataService(pageAdditionalData))
InitializeComponent()
AddHandler PrintingSystem.XlSheetCreated, AddressOf PrintingSystem_XlSheetCreated
PrintingSystem.AddService(GetType(CustomPageDataService), New CustomPageDataService(pageAdditionalData))
See Also