i have a grid that exports fine as long as it is not grouped. the exporter and the code behind are using essentially the code from here
http://help.infragistics.com/Help/NetAdvantage/Silverlight/2011.2/CLR4.0/html/xamGrid_Asynchronous_Export_to_Excel.html
when i allow grouping the grid will not export. it also fails to through the exception in the catch. if i debug and step through i can capture it
mesage
"There was an error generating the XML document."
Innerexception
"Exception of type 'System.OutOfMemoryException' was thrown."
i do not understand why this is occuring, it is not in the known issues for export
any help would be apprciated
Hi spicish2222,
Can you give me the stack trace for that exception and the version number of the assemblies you are using? There was an issue in 12.1 similar to this where including the UndoManager from the UndoRedo framework caused a StackOverflowException when exporting to excel. I want to see if the issues are related.
yes
wrote an entirly new app with new data, wouldnt you know it export still failed when i group thing
to say this would be high importance would be an understatement
excpetion thrown
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
on this line
this.excelExporter.ExportAsync(this.dg, workbook);
Do you still need assistance with this? I haven't heard from you in a while.
In all the samples you tested and confirmed to work correctly, can you spot any differences between them and your actual application that runs into this issue?
You can group by a column that has null values. The group header title will just be empty text but all the null rows will appear under there. This will also export correctly.
I made a few adjustments to how I'm loading the data from the DomainDataSource that should actually allow you to bind the grid to the data without needing to use your own middleman code to loop through all the entities and add them to a seperate list which you then bind to the grid. Here's the code I added:
DomainDataSource domainDataSource = new DomainDataSource(); NorthwndDomainContext domainContext = new NorthwndDomainContext(); domainDataSource.DomainContext = domainContext; domainDataSource.QueryName = "GetOrders"; domainDataSource.LoadedData += new EventHandler<LoadedDataEventArgs>(domainDataSource_LoadedData); domainDataSource.Load(); void domainDataSource_LoadedData(object sender, LoadedDataEventArgs e) { if (e.HasError) MessageBox("Error has occurred"); xamGrid1.ItemsSource = e.Entities; }
The data I ended up loading from the northwnd database contained around 830 records and contains many Nullable columns, many of which have null values already, so it should be pretty close to your scenario and no matter which column I group by, null value columns or valid value columns, the grid exports as expected and the data shows up grouped in the excel file. I suggest switching your data loading to look similar to mine and then try that. Also try exporting fewer records than the 550 you currently have and see if that influences the behavior at all.
i also have issues grouping by certian columns in that grid as well. i know they have nulls, although i can group by a col that has nulls in the northwind sample?