This following code causes the excel export to fail with "Key not found in Dictionary". I am using build 2041.
private void OnGridBeginExport(object sender, BeginExportEventArgs e) {
e.Layout.Bands[1].Hidden=true; }
What version are you using? Build 2041 of what version?
Can you post more information, such as the call stack of the exception?
Without any more information, by best guess is that your parent band has a formula in it which is referencing the child band, and since the child band does not exist in the exported document, it's failing to resolve the formula properly. To test my theory, you could set the ExportFormulas property on the UltraGridExcelExporter and see if the exception goes away.
NetAdvantage_WinForms_20103.2041_SR is the version.
I tried setting the following but it didn't work.
DataExcelExporter.ExportFormulas = false;//didn't work
Stack trace below...It seems to me that even though I have hidden the child band it is still trying to access the childband columns with there given keys. Then it throws up because it can't do that since I have set Hidden to true. Just a thought.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Infragistics.Win.UltraWinGrid.GridExportCache.GetDocumentBandInfo(UltraGridBand band, PlaceholderType placeHolderType) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ExportColumnHeaderCells(UltraGridExporterHelper exportHelper, UltraGridRow row, UltraGridBand band, Boolean setRowHeights) at Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.ProcessHeaderRows(UltraGridExporterHelper exportHelper, UltraGridRow row, UltraGridBand band) 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)
It worked for removing band[1] but it still doesn't explain why it is exporting that band.
It started adding an extra cell at the beginning of the row. Only for the first row though, weird.
-Ken
Thanks for the help....working through all the little problems but I think I can get there.
Hi again,
If you need any additional assistance with your issue free to contact me.
Regards
I already make some tests and I`m sure that this suggestion working. Please try and if you have any questions do not hesitate to ask RegardsGeorgi
Not resolved yet...I will try your suggestion but in either case it would seem there is a bug here. I will also try it with 2067 and see how that works out.
Hi,
Have you been able to resolve your issue ? If you have any questions do not hesitate to ask