Fault in ExcelImporter.java

0
For a long time we have problems with Excel files with the extension .XLS instead of .xls. Mendix would through the error at the end of this post. I think I found the fault and it lies in the ExcelImporter.java. The code should be: private static ExcelExtension getExcelExtension(IContext context, IMendixObject document) { String s = document.getValue(context, "Name"); if (s.toLowerCase().endsWith(".xls")) { return ExcelExtension.XLS; } else if (s.toLowerCase().endsWith(".xlsx")) { return ExcelExtension.XLSX; } else { return ExcelExtension.UNKNOWN; } } When the extension was already .XLS it would in the current code through the UNKNOWN extension. I hope somebody from Mendix could verify this. Java is not my main expertise :) Regards, Ronald [EDIT] Updated the code with Michel suggestion. li: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: File extension is not an Excel extension ('.xls' or '.xlsx'). at ExcelImporter.IVK_ImportTemplateDocument (JavaAction : 'Call 'StartImportByTemplate'') Advanced stacktrace: at mz.a(SourceFile:190) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: File extension is not an Excel extension ('.xls' or '.xlsx'). at com.mendix.core.Core.execute(SourceFile:232) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: File extension is not an Excel extension ('.xls' or '.xlsx'). at hG.b(SourceFile:217) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreException: Document could not be imported, because: File extension is not an Excel extension ('.xls' or '.xlsx'). at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:133) Caused by: com.mendix.core.CoreException: Document could not be imported, because: File extension is not an Excel extension ('.xls' or '.xlsx'). at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:418) Caused by: com.mendix.core.CoreException: File extension is not an Excel extension ('.xls' or '.xlsx'). at excelimporter.reader.readers.ExcelReader.importData(ExcelReader.java:413) at excelimporter.reader.ExcelImporter.startImport(ExcelImporter.java:123)
asked
1 answers
0

I've added this to the backlog of this module!

answered