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. Image for the cookie policy date
close icon

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

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:

4 Replies

JG Jai Ganesh S Syncfusion Team 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 



GE George 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


GE George 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


JG Jai Ganesh S Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon