Occurs after the new worksheet is added into the workbook.
Description
You can use this event to set any additional options for created worksheet.
Syntax
TOnCreateWorksheet =
procedure(Sender: TObject; Worksheet:
IXLSWorksheet) of object;
| Sender | TObject. Specifies the TDataset2Excel component that triggered the event. |
| Worksheet | IXLSWorksheet which represents a new worksheet |
Example
This example sets the PageSetup options for created worksheet
procedure TForm1.Dataset2Excel1ONCreateWorksheet(Sender: TObject;
Worksheet: IXLSWorksheet);
begin
Worksheet.PageSetup.CenterHeader := 'Monthly report';
end;