input to grid:
@Input()
public additionalExcelExportInfos: { additionalWorksheetTitle: string,
parameters: { key: string, parameterValue: any }[]
};
output in excel file:
Thanks Martin for this great support.
A custom directive seems to be the better solution. This is not the core responsibility of the grid-component.
Now we better understand the typing of worksheet, columns and rows,
and are going to give this a try.
Hi Josef,
The desired behavior could be achieved with the help of a custom directive which handles the information about the second custom sheet:
<kendo-grid sheetsDirective [rows]="secondSheetRows" [columns]="secondSheetColumns"></kendo-grid>
sheetDirective is a custom directive that adds the new sheet and sets the columns and rows passed to it. For more details please check the following example:
https://stackblitz.com/edit/angular-w3vthf-bhxggh
The Grid is designed to export and create a sheet only to the existing data. Any further customization like adding new sheets to the same exported file isn't considered as something that the Grid should handle by default. That is why handling the excelExport event and customizing the workbook is the preferable approach to achieve the desired outcome.
Regards,
Martin
Progress Telerik
Hi Martin,
Yes, the first part works fine - the excel file contains a second sheet.
The next step is adding 2 columns with some rows.
How could we add some data to this sheet?
In the description above this could come via an angular-input to the component (feature request).
Hi Josef,
I am not sure that understand the desired feature request. Please could you provide some more details about it.
If the indented behavior is to add other sheets to the exported Excel this can be done by customizing the generated workbook like:
public onExcelExport(e: ExcelExportEvent): void {
console.log(e.workbook);
e.workbook.sheets.push([]);
}
https://stackblitz.com/edit/angular-w3vthf
I am looking forward to your reply.
Regards,
Martin
Progress Telerik