posted 13 years ago
Hi All
I am planning to use the BIRT as the reporting tool, but the only constraint being that the BIRT dosen't give TXT format. So I am trying to acheive the same. For that I tried getting the EXCEL format and trying to parse the EXCEL and creating the TEXT file.
I have tried two options
1. Apache POI
2. JXL
The parsing code is working fine with an EXCEL file but when I run the code on the EXCEL generated from BIRT I am getting errors as follows
JXL API
jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:116)
at jxl.read.biff.File.<init>(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:221)
at jxl.Workbook.getWorkbook(Workbook.java:198)
at JXMExcelToText.read(JXMExcelToText.java:16)
at BIRTReportBuilder.executeExcelReport(BIRTReportBuilder.java:178)
at BIRTReportBuilder.main(BIRTReportBuilder.java:396)
Using POI
java.io.IOException: Invalid header signature; read 7311066695147732796, expected -2226271756974174256
at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:100)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:84)
at POIExcelToText.ExcelToText(POIExcelToText.java:24)
at BIRTReportBuilder.executeExcelReport(BIRTReportBuilder.java:171)
at BIRTReportBuilder.main(BIRTReportBuilder.java:389)
Kindly let me know how to proceed on the same. Also if there is any other way of gettting the TEXT file from BIRT.
BIRT VERSION:: 2.5
POI Version: poi.3.0.1FINAL
JXL Version: jxl2.6.10
BIRT Code for Excel Exporting::
EXCELRenderOption excelOptions = new EXCELRenderOption();
excelOptions.setOutputFormat("xls");
excelOptions.setOutputFileName("/QuantumFX/QFXREPORTS/BIRTSAMPLE/birt/output/Contract.xls");
task.setRenderOption(excelOptions);