Hi guys, I have an index out of bounds when I try to import data from an excel template. The excel sheet has 45 columns, and some other templates will have more. Is this a hard coded value somewhere in the code of the excel importer? I cannot see why I would be getting this kind of message. We have used the excel importer in many occasions, and several projects, albeit never with so many columns. Is this the issue? If so, how can I quickly fix it? thanks. LR. lh: com.mendix.core.CoreException: Document could not be imported, because: 45 at ExcelImporter.IVK_ImportTemplateDocument (JavaAction : 'Call 'StartImportByTemplate'') Advanced stacktrace: at mA.a(SourceFile:188) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: 45 at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:135) Caused by: com.mendix.core.CoreException: Document could not be imported, because: 45 at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:390) Caused by: java.lang.ArrayIndexOutOfBoundsException: 45
Found the issue!!
For some reason the excel importer by template starts column count at 0, although the very first versions of the importer, this was never the case (hopefully v5+ won't have these peculiarities either). Everything else starts column count at 1, so we tend to just adjust the counter in the template and add +1 to each field. As we had 45 fields, we've added an empty first column instead, and obviously forgot to remove it when executing the import.
Why would the template starts on 0 when the summary fields when you create the template default to 1? Probably won't know.
Anyway, I'll close this as I found the issue, although already stumbled upon another... oh hum.