I am using the new DataPresenterExcelExporter for a client. Previously I was using the solution from the article here to export to excel so I was excited to see how this new class works.
I am really happy that it respects the users column filters as that was something they brought up to me recently. I would however like to see some default styles that look good as I am not much of a "designer guy" which would be why I'm using your controls ;-).
Anyways I noticed an issue with the labels when exporting a three-level hierarchy like this:
Level 1 Entity
|__>Level 2 Entity
|__>Level 3 Entity
The header/labels for level 1 are fine, but at level two and three they only show for every entity after the first one in the list. So every first entity in level 2 or three is missing it's headers. This makes it a bit difficult to read unfortunately.
Chris
Sorry i should have included my code:
private static void ExportDataGridToExcelFile(XamDataGrid dataGrid, string filename) { var excelExporter = new DataPresenterExcelExporter(); var options = new ExportOptions { ChildRecordCollectionSpacing = ChildRecordCollectionSpacing.None }; DataPresenterExcelExporter.SetExcelLabelFormatSettings(dataGrid.FieldSettings, new FormatSettings { FillPattern = FillPatternStyle.Solid, FillPatternForegroundColor = Colors.LightBlue, }); DataPresenterExcelExporter.SetExcelGroupFormatSettings(dataGrid.FieldSettings, new FormatSettings { FillPattern = FillPatternStyle.Solid, FillPatternForegroundColor = Colors.LightGreen, }); DataPresenterExcelExporter.SetExcelSummaryLabelFormatSettings(dataGrid.FieldSettings, new FormatSettings { FillPattern = FillPatternStyle.Solid, FillPatternForegroundColor = Colors.LightPink, }); try { excelExporter.Export(dataGrid, filename, WorkbookFormat.Excel97To2003, options); } catch (IOException) { MessageBox.Show("Cannot save excel file, please make sure it is not already open"); } }
Hi, Chnicola,
Can you tell me which version of 9.2 release builds do you use. We had an issue of this kind and it was resolved in the first service release of 9.2.
You can get the latest Service release from here - https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
Sincerely,
Horen Kirazyan