Hi,
We are using Infragistics2.Excel assembly to export data from Infragistics UltraGrid and all of a sudden, it is throwing below error:
packageFactory cannot be null. When saving to Excel2007 workbook format and using the Infragistics2.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.Excel assembly instead, and the packaging will be handled by the WindowsBase class
My windows application is currently running on .NET Framework 4.5 and using Infragistics2 v9.2. We could not upgrade the Infragistics to 3.0 at this point so please let me know if there are any way to fix this problem:
Code:
this.ultraGridExcelExporter1.Export(this.grdActiveMonitor, saveDialog.FileName);
Thanks,
Murali
There are only 3 ways to solve this issue since there is no built-in support for packaging in .NET 2.0, against which the Infragistics2... assemblies are built:
If option 1 is not available, you must either provide a custom IPackageFactory implementation of save in an older format. Why are you not able to use the Infragistics3 assemblies in this case? They should be included with the normal Infragistics2 install.
I realize this an old post, but I am needing help with this very issue. I am using Infragistics ver 11.1.20111.2111. I tried the method you said by replacing the infragistics2 excel assembly with the infragistc3 excel assembly.
On this line:
Me.UltraGridExcelExporter1.Export(Me.GrdTimeDisplay, wksheet, 0, 0)
I get the following error when I do that.
Error 1 Reference required to assembly 'Infragistics2.Documents.Excel.v11.1, Version=11.1.20111.2111, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' containing the type 'Infragistics.Documents.Excel.Workbook'. Add one to your project. C:\Visual Studio 2013\Projects\Query Plus VS2013\QueryPlusCopyRightVS2013\QueryPlus\QueryPlus7_2\UI\WinForms\frmClaims.vb 2419 13 QueryPlus7_2
When I keep both the Infragistics2 and Infragistics3 Excel assemblies I get the following.
Dim oExcel As New Excel.Workbook
I get the following error.
Error 1 'Workbook' is ambiguous in the namespace 'Infragistics.Documents.Excel'. C:\Visual Studio 2013\Projects\Query Plus VS2013\QueryPlusCopyRightVS2013\QueryPlus\QueryPlus7_2\UI\WinForms\frmClaims.vb 2416 31 QueryPlus7_2
How do I fix this?