Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
Issue with ExcelExporter
posted

Hello,

i am trying to export a Ultra Win Grid to Excel and in the BeginExport event if ExcelExporter i have wriiten this code to add summaries:

e.Layout.Bands[0].Summaries.Add(Infragistics.Win.UltraWinGrid.SummaryType.Count, e.Layout.Bands[0].Columns[0]);

But it gives me an error which is reproduced below.

System.ArgumentNullException was caught
  Message="Value cannot be null.\r\nParameter name: key"
  Source="mscorlib"
  ParamName="key"
  StackTrace:
       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
       at Infragistics.Win.UltraWinGrid.ExcelExport.FormulaExporting.MappingManager.MapWorksheetCell(SummaryInfo summaryInfo, WorksheetCell worksheetCell)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ExportSummaryCell(UltraGridExporterHelper exportHelper, SummaryValue summary, Int32 summaryLevel, IWorksheetCellFormat defaultSummaryFormatting, Rectangle summaryRect, UltraGridSummaryRow summaryRow)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ProcessSummaryRows(UltraGridExporterHelper exportHelper, UltraGridRow row, UltraGridBand band, RowsCollection rowsCollection)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ProcessGridRowInternal(UltraGridExporterHelper exportHelper, UltraGridRow row, ProcessRowParams processRowParams)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExporterHelper.ProcessRow(UltraGridRow row, ProcessRowParams processRowParams)
       at Infragistics.Win.UltraWinGrid.RowsCollection.InternalTraverseRowsHelper(IUltraGridExporter exporter)
       at Infragistics.Win.UltraWinGrid.UltraGrid.Export(IUltraGridExporter exporter)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, Worksheet worksheet, Int32 startRow, Int32 startColumn)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, WorkbookFormat workbookFormat)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, String fileName, WorkbookFormat workbookFormat)
       at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(UltraGrid grid, String fileName)
       at Mercury.Presentation.Common.GridSelector.btnExport_Click(Object sender, EventArgs e) in D:\Mercury New\Mercury.Presentation\Common\GridSelector.cs:line 82
  InnerException:

 

The same code works correctly when I export the grid to PDF using DocExporter. Please help.