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.
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.
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?
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.
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.
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.