How would I export a wpf xamPivotGrid to Excel?
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?
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.
Developer Support Engineer
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?
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.