Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
packageFactory error while exporting data using Infragistics2.Excel
posted

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

Parents
  • 44743
    Suggested Answer
    posted

    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:

    1. Use the Infragistics3... assemblies for the Excel and ExcelExporter. These are compiled against .NET 3.0 and can therefore use the built-in packaging support
    2. Provide your own IPackageFactory implementation which can manage the creation of zip packages, along with the associated content types and rels files present in all Office Open XML files.
    3. Save in the 2003 formats instead.

    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.

Reply Children
No Data