I used some sample code I found on the Infragistics web site to write a group of DataTables to an Excel spreadsheet workbook in Excel 2007 format, with separate worksheets for each DataTable. However on the workbook.Save (fileName) method call, I get an exception that states:
"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"
I'm creating a WinForm client application targeting .NET 3.5. I have installed the latest version of Infragistics 10.3 WinForm libraries and I have no Infragistics3.Excel assemblies available, only Infragistics2.Excel assemblies show up.
Where can I find the Infragistics3.Excel assembly referred to in the exception?
If it is not available, then how do I create a simple default IPackageFactory similar to the one that you've implemented in your Infragistics3.Excel assembly.
Thanks for any suggestions or help you can provide.
You project reference are referencing Infragistics2.Excel instead of Infragistics3.Excel. You just have to remove the former and add the later. They are both installed with NetAdvantage. Just right-click on the project references in Visual Studio and select "Add Reference" and then choose Infragistics3.Excel from the list.
Thanks for the clarification - I should have realized the answer myself. I hadn't installed both versions, which is why I had only seen the .NET 2.x compabile version of the Infragistics assemblies.
Upgrading is a simple solution to my problem - appreciate the response.
cpaul said:I hadn't installed both versions
I was not aware that the installer even gives you the option to install one or the other. I thought they both installed automatically.
I think I'm confused.
Based on your original comments I had thought that there were two entirely different versions of the WinForm 10.3 libraries, one with all module names Infragistics2.xxx, where all modules are .NET 2.0 compatible - and another set with duplicate modules, all with names Infragistics3.xxx that were .NET 3.5 compatible.
However if I look at my installation "Bin" folder, I only have two WinForm Infragistics3.xxx assemblies available:
Infragistics3.Excel.v10.3.dll and Infragistics3.Win.UltraWinGrid.ExcelExport.v10.3
So are these the only .NET 3.5 specific assemblies that you have created for the WinForm library?
Hi,
That's correct, it's just those two assemblies which are available in CLR2 and CLR3. All of the others are CLR2.
The reason for this is that the Excel assemblies need packaging support in order to handle exporting to Office2007 format. This support is only available in CLR3.
But updating all of the other assemblies to CLR3 would mean that they would not be usable in CLR2, so we didn't want to limit their use.
Hi all!
Have the same problem. Removing the old excel2 and add the Excel3 causes some strange errors:
Me.UltraGridExcelExporter1.DefaultWorkbookPaletteMode = Infragistics.Excel.WorkbookPaletteMode.StandardPalette
is not longer working (Text translated: via google ;-(:
Error 3 on the assembly "Infragistics2.Excel.v9.2", the "Infragistics.Excel.WorkbookPaletteMode" includes, reference is made indirectly. Add the project reference to a file "C: \ Program Files \ Infragistics \ NetAdvantage 2009.2 \ windows forms \ bin \ Infragistics2.Excel.v9.2.dll" added
)
Also
exporter.Export(locGrid, xFile.Worksheets(0))
gives me an error (worked fine with Excel2)
rgds
Wolfgang
Hello Boris,
yes it worked, thank you for the hint.
Is there a list of changes since build 8.3 - 1009 ?
Just to know what we should retest in our application.
Regards,
Jan
Hello Jan,
Could you please try this out with the latest service release of version 8.3 - '2138' and let me now if it worked for you.
Hello Mike,
we using 8.3, does it work as well ? I replaced all references to Infragistics2.Win.UltraWinGrid.ExcelExport.v8.3 and Infragistics2.Excel.v8.3.dll with Infragistics3.*, rebuilt all projects but I am receiving this error when I try export grid with 66 k rows:
Fail: Can't export more rows than MaxExcelRowCount. Use FileLimitBehaviour property if you want to change default behaviour.
I call
_excelExporter.Export(ug, filename,Infragistics.Excel.
WorkbookFormat.Excel2007);
and the filename has xlsx extension.
Do I need to do something else?
Thanks.
Regards.
Hi Wolfgang,
The error message here clearly indicates that your application is still reference the Infragistics2.Excel assembly.
Make sure you are using Infragistics3 for both the Excel and the Wingrid Exporter assembly.
If you have more than one project in your solution, make sure you check all of the projects.
Also, open up the license.licx file for your project(s) and delete the contents of that file, in case it's referencing the wrong assemblies.