I have a method to generate report made with jett:
Map<String, Object> beans = new HashMap<String, Object>();
beans.put("fichasTecnicasMateriaPrimaResumo", fichasTecnicasMateriaPrimaResumo);
try {
InputStream inPath = ProdutoManagedBean.class.getResourceAsStream("/template.xls");
ExcelTransformer transformer = new ExcelTransformer();
transformer.transform(inPath, beans);
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidFormatException e) {
e.printStackTrace();
}
I'm having an InvalidFormatException in transformer.transfom (...):
22:44:37,803 ERROR [stderr] (default task-28) org.apache.poi.openxml4j.exceptions.InvalidFormatException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
When I change the file extension to .ods the exception changes:
12:46:34,703 ERROR [stderr] (default task-57) java.util.zip.ZipException: unexpected EOF
I generated the files by microsoft office and libreoffice and both gave an error.