Null Reference exception with Excel/PDF or CSV export

I have a fairly complex grid with 3 levels of grouping, with aggregate totals for each level and grand totals in the footer with lazy loading and virtualization. When trying to export in any format I get the error below. Some of the aggregates are manually calculated in my own functions and I have a feeling that's where the issue might be. From reading the forums it seems that similar errors were corrected in updates to your software but I must be doing something unique. 


 [2022-02-07T14:52:46.261Z] Error: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.RenderGroupSummaryCaption(GridAggregateColumn summaryCol, GridColumn SummaryGridColumn, Group`1 context, Int32 count, Int32 captionSummaryIndex) at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.RenderGroupedRows(Group`1 context, Int32 groupLevel) at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.RenderGroupedData(IEnumerable`1 groupedDatasource, Int32 groupLevel) at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ProcessGridContents() at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.IterateElements() at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExecuteResult(SfGrid`1 GridModel, Object dataSource) at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExportHelper(SfGrid`1 gridModel, Object dataSource) at Syncfusion.Blazor.Grids.Internal.GridExcelExport`1.ExcelExport(SfGrid`1 GridModel, ExcelExportProperties ExportProperties) at Syncfusion.Blazor.Grids.SfGrid`1.ExcelExport(ExcelExportProperties excelExportProperties, Nullable`1 isMultipleExport, Object workbook, Nullable`1 isBlob) at PCFDashboard.Pages.OverallPerformance.ToolbarClick(ClickEventArgs args) in C:\Development\WebSites\PCFDashboard\PCFDashboard\Pages\OverallPerformance.razor:line 389


1 Reply

VN Vignesh Natarajan Syncfusion Team February 8, 2022 06:07 AM UTC

Hi Sheldon,  
 
Thanks for contacting Syncfusion support.  
 
Query: “When trying to export in any format I get the error below. 
 
We need some more details about the issue you are facing. So kindly share the following details.  
 
  1. Share the Grid code example along with exporting codes.
  2. Also share details about the aggregate with custom function definitions where you have performed own calculation.
  3. Share your Syncfusion Blazor NuGet package version details
  4. If possible share simple issue reproducible.
  5. Also confirm whether you have used any exporting events. (ExcelAggregateTemplateInfo)
 
The above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.  
 
Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon