We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridDataControlExportExtensions.ExportToExcel with Columnstyle CurrencyEdit

Thread ID:

Created:

Updated:

Platform:

Replies:

105520 Nov 1,2012 01:33 PM Nov 25,2012 01:26 PM WPF 1
loading
Tags: GridControl
Marcus Nilsson
Asked On November 1, 2012 01:33 PM

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:

Rajasekar G [Syncfusion]
Replied On November 25, 2012 01:26 PM

Hi Marcus,

 

Sorry for the inconvenience caused. We have tested the reported issue in different scenario but we are unable to reproduce the issue. Could you please check the below sample?

 

Sample: GridDataControlSample.zip

 

We suspect you are using our grid in some other scenario, So If possible could you please modify our sample and revert us with replication procedure, that would be very helpful to resolve your problem earlier.

 

Please let know if you have any queries.

 

Thanks,

Rajasekar

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;