hi,
I try to load nearly a million records to my data structure and page those records using ultrawinGrid only 1000 at a time. This helps me avoid System.OutOfMemory exceptions which could cause otherwise trying to load them directly to an ultrawingrid.
But I have a functionality to export this grid (the entire pages and not 1000 pages alone) to excel. In order to achieve this, I programatically create an ultraWinGrid, and use an ultraDatasource to point to my already loaded data structure. Although I set up my ultraGrid.Datasource property to this ultraDatasource, I am not able to export it using ultraGridExcelExporter. Should I call InitializeRow on all the rows in the programatically created ultrawinGrid?
Thanks for the help in advance.
Shankar
Hi, I am using UltraGridExcelExporter.Export function to export the rows to excel. However, in my case, where the data is in two bands, when user expands the parent row I get the child rows for that row. I do not load all the child rows upfront. I used BeforeRowExpanded event of grid to load the child rows and add to the dataset bound to grid. I have custom implementation of export selected rows only to excel. But in case when I group by on some column, and try to export the selected rows, BeforeRowExpanded event occurs for each row starting from 1st row. I am unable to understand why BeforeRowExpanded event is getting raised for all the rows. In code , I have not expanded any row. How can I avoid this? I do not want to load all child rows before exporting selected rows to excel. If I do not group by , this BeforeRowExpanded event does not get raised before export. If I put break point on the event, The call stack shows me- > bo.Core.Win.dll!Adaptiv.Operations.Core.DataBrowse.Win.DataBrowserControl.browseGrid_BeforeRowExpanded(object sender, Infragistics.Win.UltraWinGrid.CancelableRowEventArgs e) Line 1189 C# Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGrid.OnBeforeRowExpanded(Infragistics.Win.UltraWinGrid.CancelableRowEventArgs e) + 0x98 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(Infragistics.Win.UltraWinGrid.GridEventIds id, System.EventArgs e) + 0xe21 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGridRow.Expanded.set(bool value) + 0x183 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGridGroupByRow.UltraGridGroupByRow(Infragistics.Win.UltraWinGrid.UltraGridBand band, Infragistics.Win.UltraWinGrid.RowsCollection parentCollection, Infragistics.Win.UltraWinGrid.UltraGridColumn groupByColumn, object commonValue) + 0xad bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGridGroupByRow.UltraGridGroupByRow(Infragistics.Win.UltraWinGrid.UltraGridBand band, Infragistics.Win.UltraWinGrid.RowsCollection parentCollection, Infragistics.Win.UltraWinGrid.UltraGridColumn groupByColumn, Infragistics.Win.UltraWinGrid.UltraGridRow firstRow) + 0x11b bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.CreateGroupByRowsHelper(Infragistics.Win.UltraWinGrid.UltraGridRow[] rows, ref int startIndex, bool rowsAlreadySorted) + 0x22a bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.InitGroupByRows() + 0x213 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.SyncRowsHelper(System.Collections.IList boundList) + 0x944 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows() + 0x82c bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.EnsureNotDirty() + 0x70 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.EnsureFiltersEvaluated() + 0x356 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.VerifyAgainstScrollVersion() + 0xca bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ScrollCountManagerSparseArray.GetItemAtVisibleIndex(int visibleIndex) + 0x2c bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtVisibleIndex(int visibleIndex, bool includeSpecialRows) + 0xe9 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetFirstVisibleRow(bool includeSpecialRows) + 0x34 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowsCollection.GetFirstVisibleRow() + 0x2a bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.FirstRow.get() + 0x41a bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ViewStyleBase.RecreateRowList(Infragistics.Win.UltraWinGrid.RowScrollRegion rsr) + 0x13f bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(bool resetScrollInfo) + 0xfa bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows() + 0x2a bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(Infragistics.Win.UltraWinGrid.ScrollbarVisibility assumeColScrollbarsVisible) + 0x21e bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ScrollRegionBase.WillScrollbarBeShown() + 0x39 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ViewStyleBase.AddBandHeaders(Infragistics.Win.UltraWinGrid.ColScrollRegion csr, Infragistics.Win.UltraWinGrid.UltraGridBand band) + 0x258 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ViewStyleVertical.RecreateHeaderList(Infragistics.Win.UltraWinGrid.ColScrollRegion csr) + 0x2af bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegion.RegenerateVisibleHeaders() + 0x104 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper() + 0x139 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics() + 0x50 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGridLayout.ApplyLoadedBands() + 0x3c3 bytes Infragistics2.Win.UltraWinGrid.v10.2.dll!Infragistics.Win.UltraWinGrid.UltraGrid.Export(Infragistics.Win.UltraWinGrid.IUltraGridExporter exporter) + 0x1f7 bytes Infragistics2.Win.UltraWinGrid.ExcelExport.v10.2.dll!Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(Infragistics.Win.UltraWinGrid.UltraGrid grid, Infragistics.Excel.Worksheet worksheet, int startRow, int startColumn) + 0x3ea bytes Infragistics2.Win.UltraWinGrid.ExcelExport.v10.2.dll!Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter.Export(Infragistics.Win.UltraWinGrid.UltraGrid grid, Infragistics.Excel.Workbook workbook, int startRow, int startColumn) + 0x121 bytes Regards, Vani.
Hello Emoreau,
What we were discussing here was an issue connected with our excel engine when using 97-2003 excel files, and it was fixed long time ago.
The mentioned limitation only exists up to Excel 2003, and there is no such limitation if you are using Excel 2007. If you would like to export just a portion of the rows on a single worksheet and the other portion to another, you could take a look at the following forum thread where you would be able to find some guidelines how to achieve the desired behavior:
http://community.infragistics.com/forums/p/33116/232324.aspx
If you have any other questions please do not hesitate to contact us.
Has a ready-made code sample of that workaround has been made available since then?
Hello Shankar,
The following case has been created based on your issue: CAS-55950-X6ZX52
Please let me know if you need any further assistance.
Okay, now I am getting even more confused. :)
shankarchandru said:I keep track of ultragrid row count and call export on the same workbook by adding and setting an active worksheet before calling export method.
What does "calling export on the same workbook" mean? A workbook doesn't have an export method I am aware of. It sounds like you are trying to break up the grid into multiple worksheets so that you can fit everything into one workbook. In such a case, the grid would still have to loop through the rows prior to the one where the second sheet would begin. But I don't see any reason for it to continue to loop through rows that are beyond the limit of the number of rows which can be exported.
I may be wrong, though. There might be a reason why this has to happen or that it cannot be stopped.
In any case, in order to do anything about this, we will need to see a small sample project demonstrating the issue so we can check it out. There are too many variables here for us to guess what's happening or why without a concrete sample to work with.