0
I have a way of generating reports done 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 am having an Invalidformatexception on 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 switch the file extension to . ods the Exception changes:
12:46:34,703 ERROR [stderr] (default task-57) java.util.zip.ZipException: unexpected EOF
I managed the files by microsoft office and libreoffice and both gave error.