Declined
Last Updated: 15 Jan 2024 14:21 by Josef
Josef
Created on: 22 Jun 2023 12:04
Category: Kendo UI for Angular
Type: Feature Request
0
Angular Grid Excel Export with second worksheet containing a simple key-value pair

 

input to grid:

@Input()
public additionalExcelExportInfos: { additionalWorksheetTitle: string, 
parameters: { key: string, parameterValue: any }[]
};

 

output in excel file:

4 comments
Josef
Posted on: 15 Jan 2024 14:21

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.

ADMIN
Martin Bechev
Posted on: 15 Jan 2024 13:33

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

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Josef
Posted on: 15 Jan 2024 06:57

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).

ADMIN
Martin Bechev
Posted on: 12 Jan 2024 15:17

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

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources