Back to Devexpress

PrintingSystemBase.XlSheetCreated Event

corelibraries-devexpress-dot-xtraprinting-dot-printingsystembase-2b6786d4.md

latest4.9 KB
Original Source

PrintingSystemBase.XlSheetCreated Event

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

Declaration

csharp
public event XlSheetCreatedEventHandler XlSheetCreated
vb
Public Event XlSheetCreated As XlSheetCreatedEventHandler

Event Data

The XlSheetCreated event's data class is XlSheetCreatedEventArgs. The following properties provide information specific to this event:

PropertyDescription
IndexSpecifies the Excel sheet index number.
SheetNameSpecifies the Excel sheet name.

Remarks

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.

reporting-web-cacheddocumentsource-custom-data/CS/CustomCachedDocumentSourceSerialization/CategoriesReport.cs#L11

csharp
InitializeComponent();
this.PrintingSystem.XlSheetCreated += PrintingSystem_XlSheetCreated;
this.PrintingSystem.AddService(typeof(CustomPageDataService), new CustomPageDataService(pageAdditionalData));

reporting-web-viewer-document-custom-data/CS/CustomCachedDocumentSourceSerialization/CategoriesReport.cs#L11

csharp
InitializeComponent();
this.PrintingSystem.XlSheetCreated += PrintingSystem_XlSheetCreated;
this.PrintingSystem.AddService(typeof(CustomPageDataService), new CustomPageDataService(pageAdditionalData));

reporting-web-cacheddocumentsource-custom-data/VB/CustomCachedDocumentSourceSerialization/CategoriesReport.vb#L13

vb
InitializeComponent()
AddHandler PrintingSystem.XlSheetCreated, AddressOf PrintingSystem_XlSheetCreated
Me.PrintingSystem.AddService(GetType(CustomPageDataService), New CustomPageDataService(pageAdditionalData))

reporting-web-viewer-document-custom-data/VB/CustomCachedDocumentSourceSerialization/CategoriesReport.vb#L14

vb
InitializeComponent()
AddHandler PrintingSystem.XlSheetCreated, AddressOf PrintingSystem_XlSheetCreated
PrintingSystem.AddService(GetType(CustomPageDataService), New CustomPageDataService(pageAdditionalData))

See Also

PrintingSystemBase Class

PrintingSystemBase Members

DevExpress.XtraPrinting Namespace