Hi,
I'm using a few customized summary classes for my ultragrid (having implemented the ICustomSummaryCalculator). However I can't figure out how to get the ExcelExporter to export these summaries into the Excel doc. Everything is showing up except these summaries. I'm using ver 8.2 Please help!
You should not have to do anything, all summaries should be exported automatically.
Are you seeing the summary row/cells in the Excel file and the cells are just blank? Or are you not seeing the summary row or cell at all?
It's possible that maybe the grid cannot (or just is not) copying your ICustomSummaryCalculator to the cloned layout. If that is the case, it sounds like a bug to me, but no more updates are being made to v8.2. So you would have to work around it in that version.
Probably, all you have to do is re-apply the summary to the layout which is passed in to the BeginExport event of the UltraGridExcelExporter.
Hi Mike,
I am facing the same issue in Ultragrid. I am also using CustomSummarySettings implemeted thru ICustomSummaryCalculator. While trying to use "Excel to Export" getting error "If summaryType is Custom, then a valid instance of ICustomSummaryCalculator must be passed in." at below line of code:
Dim activeChild As Form = Me.ActiveMdiChildDim uGrid = TryCast(activeChild.ActiveControl, UltraGrid)
UltraGridExcelExporter1.Export(uGrid, WB.Worksheets.Add(ExportTab)) 'Error at this line
Can you please share some sample code, how can i achieve the same?
Hi Piyusha,
What version of the controls are you using? This issue was presumably fixed a long time ago, so it should only be a problem if you are using a very old version.
Another potential workaround would be to make sure you use the InitializeLayout event to add your summary and the ICustomSummaryCalculator. That way, the summary will get correctly added to both the on-screen grid and the export layout since each will be initialized.
I can't give you the dlls, they are installed with NetAdvantage.
The project I attached here references the Infragistics3 assemblies and the error message you are getting is because you must have changed it to the Infragistics2 assemblies. Why did you change the project references? You need to change them back to point to the correct references. Or just download the sample again and run it without changing the references. I just downloaded the sample again just to make sure I did it correctly and it's using 11.1 and it is. But I noticed that some of the assemblies have CopyLocal set to true, so that might be a problem. You should set that to false if the project is having trouble finding the assemblies on your machine.
Thanks Mike,
I tried to run your sample project but it is giving following error:
packageFactory cannot be null. When saving to Excel2007 workbook format and using the Infragistics2.Documents.Excel assembly, you must provide an IPackageFactory to handle the packaging of data. If you are using the DotNet Framework 3.0 or higher, use the Infragistics3.Documents.Excel assembly instead, and the packaging will be handled by the WindowsBase class
at Line: this.ultraGridExcelExporter1.Export(this.ultraGrid1, filename);
Can you please share infragistcs3 dlls, am not able to get it.
FYI, I am using .Net framework 4.0 and i need to export Child grid as export button is on MDI form. I am able to export all the ultra grids without summary calculator.
I tried this out in a small sample project (which I have attached here) and it works for me in every version as far back as I can go. I went all the way back to v8.1 and it's working correctly for me even in that old version.
Try my sample and see if it works for you. If it does, then your application must be doing something differently and we will need to find out what that is in order to solve the issue. If my sample does not work for you, then my best guess is that you just need to get the latest service release - although that seems very unlikely, since anything that was fixed in the 8.1 service release was certainly in the 11.1 release.
Thanks for response.
I am using V11.1 with DLL "Infragistics2.Documents.Excel.v11.1.dll".
Also am adding customsummary settings at initializelayout event of grid however getting the issue.