Attempting to export grid data on Win7 64-Bit with Office 2010 64-bit generates the following error:
Index was out of range. It must be non-negative and less than the size of the collection.Parameter name: indexActual value was 0., Exporting to file = 'C:\Users\Administrator\AppData\Local\Temp\Customers_5AB5.tmp'; Using template = 'C:\Program Files (x86)\Sage Software\Sage MAS 500 Client\GridTemplates\empty.xlsx'; Excel file format = 'Unknown'. at Infragistics.Excel.WorksheetCollection.get_Item(Int32 index) at Infragistics.Excel.Workbook.OnAfterLoadGlobalSettings(WorkbookSerializationManager manager) at Infragistics.Excel.Serialization.Excel2007.XLSX.Elements.WorkbookElement.OnAfterLoadChildElements(Excel2007WorkbookSerializationManager manager, ElementDataCache elementCache) at Infragistics.Excel.Serialization.Excel2007.XmlElementBase.LoadChildElements(Excel2007WorkbookSerializationManager manager, ExcelXmlNode node, ExcelXmlDocument document, XmlReader reader, ElementDataCache elementCache, List`1 elementCacheCollection, BeforeLoadElementCallback beforeLoadElementHandler, AfterLoadElementCallback afterLoadElementHandler, Boolean& isReaderOnNextNode) at Infragistics.Excel.Serialization.Excel2007.XmlElementBase.LoadChildElements(Excel2007WorkbookSerializationManager manager, ExcelXmlNode node, BeforeLoadElementCallback beforeLoadElementHandler, AfterLoadElementCallback afterLoadElementHandler, Boolean& isReaderOnNextNode) at Infragistics.Excel.Serialization.Excel2007.XmlContentTypeBase.Load(Excel2007WorkbookSerializationManager manager, Stream contentTypeStream) at Infragistics.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPart(IPackagePart part) at Infragistics.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPartRelationships(IEnumerable`1 relationships, ContentTypeBase contentType) at Infragistics.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadWorkbookContents() at Infragistics.Excel.Serialization.WorkbookSerializationManager.Load() at Infragistics.Excel.Workbook.LoadXLSXFile(Workbook workbook, Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) at Infragistics.Excel.Workbook.LoadHelper(Stream stream, WorkbookFormat format, String parameterName, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) at Infragistics.Excel.Workbook.Load(String fileName, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
The excel file is 2010 file format, a workbook with three blank sheets.
Hello,
I am not sure about your scenario, you mentioned that you are exporting the grid data, but you also mentioned when you load template. Also Is far I can see you are using xlsx file . Can you please give me more clarification about your scenario, what exactly you are doing in the code, and also the excel file that you are trying to load or create, is that existing file and what format. Also can you please let me know which exact version are you suing?
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Our code is exporting the grid to a "template". First we load the template then export the contents of the grid to a sheet on the loaded workbook. The "template" was created using Excel 2010 64-bit version. Simply open Excel and save the default workbook, i.e. there is no data or formatting in the workbook sheets. On another thread I found a solution. Turn off the verify2007format flag. Seems Excel 2010 has a slightly different format then Excel 2007. This is causing Infragistics verify code to fail. We are using:
Infragistics2.Win.UltraWinGrid.DocumentExport.v10.3
Infragistics3.Excel.v10.3
Infragistics3.Win.UltraWinGrid.ExcelExport.v10.3