Unplanned
Last Updated: 05 Jan 2022 14:08 by ADMIN
Philip
Created on: 22 Dec 2021 09:37
Category: UI for Blazor
Type: Feature Request
4
Customize multi-column headers export to Excel and CSV

Hello

 

The column group headers functionality is great, however it messes with the export to excel/csv, as the headers no longer align on the 1 row.

 

Just seeing if there was a way to export to csv/excel but ignore the column group headers? Maybe a feature on the <GridCsvExport ExportGroupHeaders=false /> option?

 

Or is there a way to turn off column group headers programmatically? Then this could be removed then readded on the events; OnBeforeExport, OnAfterExport

 

Cheers

Phil

3 comments
ADMIN
Stamo Gochev
Posted on: 05 Jan 2022 14:08

Hi,

Thanks for the clarification. I see what you mean and thus I will update the title of this feature request and mark it as approved. Once it receives enough votes, we will consider what will be the best way to handle it.

Regards,
Stamo Gochev
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!
Philip
Posted on: 30 Dec 2021 00:58

Hi Stamo

 

I have used the wrong terminology, by "column groups" i meant "Multi-column headers".
https://docs.telerik.com/blazor-ui/components/grid/columns/multi-column-headers

It currently is not functioning; when you export the grid with multi-column headers, all the regular headers are misaligned in the grid; for example, if some columns are not in a group and some are in a group, then the exported excel is a mess.

Regarding your query on why users would want to see data in a way otherwise shown in the UI; Generally when people are exporting a grid from a web app, it is because they want to do further analysis; such as add filters, create reports etc.... so usually a user would want the data exported in a "raw" /flat format than what they see laid out on the screen in a web app.

ADMIN
Stamo Gochev
Posted on: 29 Dec 2021 11:13

Hello Philip,

Can you provide more details about why you want to export the grid in an ungrouped way when the end-user sees a grouped grid? The reason why the headers are displayed on separate rows by default is that this matches the appearance of the grid on the web page.

Otherwise, you can manually ungroup the grid data in the "OnBeforeExcelExport" event similar to the following REPL example:

https://blazorrepl.telerik.com/GbbGQZYL24emLf8u55

For full customization of the exported file, you can use the "OnAfterExcelExpot" event and modify the "Stream" event argument directly.


Stamo Gochev
Progress Telerik

Learn about the important changes coming in UI for Blazor 3.0 in January 2022!