How would I export a wpf xamPivotGrid to Excel?
Hello,
Please see attached sample which inlcudes export to excel.
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support
I tried that sample code for exporting to Excel, and although it works, I ran into the problem that all figures are exported as strings and I manually needed to change them to numbers to continue doing some calculations in Excel.
Is there any work around for this issue?
Fabian Zandomeni
Hello Fabian,
The sample was translating the values to strings when calling the SetCellValue function. You can simply set the value of the worksheet’s cell to the value of the Pivot Data Row’s cell and then the worksheet will have the true data type.
Please see modified sample.
Sincerely,
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support
The code provided on this thread is not working with Compact Layouts. You must inactive compact layout before exporting the excel.
Can you confirm this issue?
Best Regards,
Murat.
Hello Murat,
The code used in the sample for merging cells does not take into account the compact layout when creating merged cells. This is due to the fact that the merging of cells is performed in a square as opposed to the “L” format created by the compact layout. For example in the below screenshot it will try to create a merged cell for 1/1/0001 on top of the prior merged cell created for January.
Hello Valerie,
Can you provide a working solution for Pivot Grid export to Excel? This is one of the main features of the Pivot Grid and it should not be provided 'as is'.
I would be glad if you can keep us updated on thi.s