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.
Syncfusion Feedback

Export to Excel - if there is a null value I can't export

Thread ID:

Created:

Updated:

Platform:

Replies:

124105 May 17,2016 04:22 PM UTC May 20,2016 12:30 PM UTC Silverlight 4
loading
Tags: SfDataGrid
George
Asked On May 17, 2016 04:22 PM UTC

Hi

If any row has a column with a null value, I can't export.

Is there anyway I can get around this?

Kr
George

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  StackTrace:
       at Syncfusion.Data.ItemPropertiesProvider.GetValue(Object record, String propName)
       at Syncfusion.UI.Xaml.Grid.GridItemPropertiesProvider.GetValue(Object record, String propName)
       at Syncfusion.UI.Xaml.Grid.Converter.GridExcelExportExtension.ExportRecordsToExcel(SfDataGrid grid, IEnumerable records, IPropertyAccessProvider propertyAccessProvider, IWorksheet sheet, ExcelExportingOptions excelExportingOptions, Group group)
       at Syncfusion.UI.Xaml.Grid.Converter.GridExcelExportExtension.ExportToExcel(SfDataGrid grid, ObservableCollection`1 selectedItems, ExcelExportingOptions excelExportingOptions, IWorksheet sheet)
       at SOAsci.Infrastructure.Behaviours.ExportTriggerAction.Invoke(Object parameter)
       at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
       at System.Windows.Interactivity.EventTriggerBase.OnEvent(EventArgs eventArgs)
       at System.Windows.Interactivity.EventTriggerBase.OnEventImpl(Object sender, EventArgs eventArgs)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
  InnerException:

Jai Ganesh S [Syncfusion]
Replied On May 18, 2016 02:29 PM UTC

Hi George, 
 
We have checked the reported issue in our sample by setting the column value as null but we are unable to reproduce the issue. Could you please modify the sample to replicate the issue ? This would be more helpful for us to analyze further. 
 
 
Regards, 
Jai Ganesh S 


George
Replied On May 19, 2016 01:52 PM UTC

Hi Jai

Thank you for the sample.

I have created a work around for my issue for now but will try get a sample back to you as soon as I have time.

Kind regards
George

George
Replied On May 19, 2016 02:10 PM UTC

Hi Jai

Okay have a sample for you. It's very rough - I just needed it to show the exception.

I make use of DevForce from IdeaBlade for my entities so this is kind of how some tables are linked without having to include any of the DevForce libraries.

The data shows fine in the SfDataGrid but throws the null exception on exporting to Excel.

Kind regards
George

Attachment: SilverlightGridSample_63d94d03.zip

Jai Ganesh S [Syncfusion]
Replied On May 20, 2016 12:30 PM UTC

Hi George, 
 
We are able to reproduce the issue . A support incident to track the status of this query has been created under your account. Please log on to our support website to check for further updates 
 
 
Regards, 
Jai Ganesh S 


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.

Warning Icon 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.Close Icon

;