ExcelExport doesn't work (Object reference not set to an instance of an object.)

Hi,
when I try to execute an export via the function ExcelExport() then an exception is thrown with the following details:
"Object reference not set to an instance of an object."
"   at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExecuteResult(SfGrid`1 GridModel, Object dataSource)\n   at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExportHelper(SfGrid`1 gridModel, Object dataSource)\n   at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExcelExport(SfGrid`1 GridModel, ExcelExportProperties ExportProperties)\n   at Syncfusion.Blazor.Grids.SfGrid`1.ExcelExport(ExcelExportProperties excelExportProperties, Nullable`1 isMultipleExport, Object workbook, Nullable`1 isBlob)\n   at HQSB.Web.Ui.Components.BaseControls.HQGrid`2.ExcelExport() in /Users/svenborisbornemann/Documents/hqlabs/repositories/hq-blazor-solution/hq-blazor/Components/BaseControls/Grid/HQGrid.razor:line 446"

I think it's related to the data, because the Read function of the Custom DataAdaptor we use works. I wasn't able to create an example, but I collect all data which might help you.
In the DataAdaptor we use an IQueryable to fetch the data out of our DB. And I serialized the data into the Json file you can find in the attachment. There you can find the Grid, DataAdaptor and the models as well.
Thanks for your support.
Best regards.

Attachment: Syncfusion_Grid_Export_968cbc6d.zip

5 Replies 1 reply marked as answer

UN Unknown December 2, 2020 09:32 AM UTC

Hi, any chance you can check this? Causing us a lot of trouble with our customers.

Thanks



UN Unknown December 3, 2020 12:31 PM UTC

It also not work with the newest version 18.3.52.


RS Renjith Singh Rajendran Syncfusion Team December 3, 2020 01:33 PM UTC

Hi Nils, 
 
Greetings from Syncfusion support. 
 
We have confirmed this as a bug and logged the defect report “Problem with ExcelExport when bind CustomAdaptor in Gridfor the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our upcoming bi-weekly release which is expected to be rolled out by the mid of December 2020.  
    
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    

Until then as a workaround, we suggest you to add the below highlighted codes in your application to overcome the problem. 

 
public async Task ExcelExport() 
{ 
    ExcelExportProperties ExcelProp = new ExcelExportProperties(); 
    await Grid.ExcelExport(ExcelProp); 
} 


Regards, 
Renjith Singh Rajendran 


Marked as answer

UN Unknown December 3, 2020 03:48 PM UTC

Thank you, the workaround works.


RS Renjith Singh Rajendran Syncfusion Team December 4, 2020 05:16 AM UTC

Hi Nils, 

Thanks for your update. 

Please follow up on the provided feedback link on future updates regarding this issue.  

Regards, 
Renjith R 


Loader.
Up arrow icon