This is a migrated thread and some comments may be shown as answers.

Using (async) pipes for Excel export values

3 Answers 552 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lukas
Top achievements
Rank 1
Lukas asked on 20 Dec 2017, 11:42 AM

Hello,

I have a Grid with a column where I use an async pipe to format the displayed value using a custom cell template

<ng-template kendoGridCellTemplate let-dataItem>
{{dataItem.Value | myPipe}}>
</ng-template>

 

Unfortunately I could not find a way to do this same transformation for the exported data. Is there a way to use async pipes or pipes in general in combination with the Excel export functionality?

Regards,
  // Lukas

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 20 Dec 2017, 12:06 PM
Hi Lukas,

Indeed, column formats, cell templates, and detail templates are ignored:

https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#toc-known-limitations

You can customize the generated workbook via handling the excelExport event, and manipulating all values in accordance with your preference:

https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#toc-customizing-generated-workbooks

Existing cells and values can be customized, and new rows, columns, and even sheets can be added on the fly.

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Lukas
Top achievements
Rank 1
answered on 20 Dec 2017, 01:43 PM

Hi Dimiter

Thank you for the quick reply and the links. I'll work around this somehow, but I feel like I have to point out one important detail: The known limitations section says

"During the export to Excel, the Grid does not use column templates. It
exports only the data. The reason for this behavior is that a column
template might contain arbitrary HTML which cannot be converted to Excel
column values."

That is not entirely correct, because

  1. HTML text is perfectly acceptable content for an Excel cell (it's just a string) - after all, I can just put the string "<strong>foo</strong>" into the property that is used to generate the Excel cell value.
  2. I could easily define a template that does not contain HTML tags and therefore would not cause an issue even if it was an issue in the first place.

Regards,
  // Lukas

0
Dimiter Topalov
Telerik team
answered on 22 Dec 2017, 06:38 AM
Hello Lukas,

Thank you for your feedback and detailed observations. We will consider updating the documentation to better specify the Excel Export limitations.

Have a nice holiday season!

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Lukas
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Lukas
Top achievements
Rank 1
Share this question
or