Hello
I have a problem when I try to export my grid to Excel. I have narrowed the problem down to Columnstyle CurrencyEdit, when I remove the Columnstyle everything works. Is there anyway to keep the style and still export or what can I do?
XAML:
<syncfusion:GridDataVisibleColumn MappingName="TotalFees"
HeaderText="{Binding Source={x:Static prop:Resources.frmEconomicScedularStatistic_TotalFees}}"
Width="80" >
<syncfusion:GridDataVisibleColumn.ColumnStyle>
<syncfusion:GridDataColumnStyle
HorizontalAlignment="Right" CellTypeEnum="CurrencyEdit">
</syncfusion:GridDataColumnStyle>
</syncfusion:GridDataVisibleColumn.ColumnStyle>
</syncfusion:GridDataVisibleColumn>
EXCEL:
try
{
if (gridData.ItemsSource != null)
{
Syncfusion.Windows.Controls.Grid.Converter.GridDataControlExportExtensions.ExportToExcel(this.gridData, @"result.xls", Syncfusion.XlsIO.ExcelVersion.Excel97to2003);
System.Diagnostics.Process.Start(@"result.xls");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
ERROR:
System.NullReferenceException occurred
HResult=-2147467261
Message=Objektreferensen har inte angetts till en instans av ett objekt.
Source=Syncfusion.GridConverter.Wpf
StackTrace:
vid Syncfusion.Windows.Controls.Grid.Converter.GridExcelConverterControl.GridCellToExcel(GridModel gridModel, Int32 row, Int32 column, IRange range)
vid Syncfusion.Windows.Controls.Grid.Converter.GridDataControlExportExtensions.ExportToExcel(GridDataControl gridDataControl, GridRangeInfo gridRange, IWorksheet workSheet, IRange excelRange)
vid Syncfusion.Windows.Controls.Grid.Converter.GridDataControlExportExtensions.ExportToExcel(GridDataControl gridDataControl, String fileName, ExcelVersion excelVersion)
vid Opus.UI.Wpf.Windows.frmEconomicScedularStatistic.cmdExcel_Click(Object sender, RoutedEventArgs e) i c:\WS\Dev\Opus.UI.Wpf\Windows\frmEconomicScedularStatistic.xaml.cs:rad 568
InnerException: