I export data from my grid to Excel (v2013.1.422.45). Data grouped by some field.
var options = new GridViewExportOptions
{
Format = ExportFormat.ExcelML,
ShowColumnHeaders = true,
ShowColumnFooters = true,
ShowGroupFooters = true,
Encoding = Encoding.UTF8
};
gridControl.Export(stream, options);
Groups are missing. I tried to use ElementExporting handler but there is no event with ExportElement.GroupHeaderRow (GroupHeaderCell, GroupIndentCell) data (just Footer).
5 Answers, 1 is accepted
The data will be exported in grouped state, but group rows will be visually displayed only in HTML format. What you can try instead is to benefit from our new ExportToXlsx method. In that way you will have everything exported just as it is in the grid.
Regards,
Maya
Telerik
Thank you for the answer.
Is there any way to add Group information (visually displayed) to Excel file using my version and ExcelML format?
Also ... If I use HTML format Excel displays warning message (like http://docs.telerik.com/devtools/wpf/controls/radgridview/export/troubleshooting/warning-message-excel). How can I fix it?
You can test the functionality in our demos.
Regards,
Maya
Telerik
[quote]
Is there any way to add Group information (visually displayed) to Excel file using my version and ExcelML format?Also ... If I use HTML format Excel displays warning message (like http://docs.telerik.com/devtools/wpf/controls/radgridview/export/troubleshooting/warning-message-excel). How can I fix it?
[/quote]
???
You can modify the exported file in ElementExported event as illustrated in the "Export" article. However, since the group rows are not exported, you will need to implement custom logic, find the last row of certain group and insert group row after it.
Regards,
Maya
Telerik