shanood Posted July 12, 2010 Share Posted July 12, 2010 Hi, We get the below error while running a jasper report in excel format. It works fine in HTML and PDF format. “Excel found unreadable content in the file. Do you want to recover the contents of this workbook.” If we give “yes” the report is not coming in the proper format. The report comes properly in excel for less number of records. Attached is the jrxml file from which we are creating the report. Also attached is the java code through which we are creating the excel report. I shall be higly obliged if anyone could help me resolve the issue as I have been facing this issue for quite some time. Link to comment Share on other sites More sharing options...
lucianc Posted July 16, 2010 Share Posted July 16, 2010 If you suspect the problem is the number of records, take a look at the net.sf.jasperreports.export.xls.max.rows.per.sheet property. Set a value for it (65535 is a common option) and see if the XLS output is fine.Regards,Lucian Link to comment Share on other sites More sharing options...
shanood Posted July 18, 2010 Author Share Posted July 18, 2010 Thanks Lucian for the update. But I can't find the MAXIMUM_ROWS_PER_SHEET property. Can you please specify in which version it is available.We are using Jasper Report Version : 1.5.0_10 Link to comment Share on other sites More sharing options...
prani_vel Posted July 19, 2010 Share Posted July 19, 2010 I guess the problem is with the API you are using . Try using JExcelAPI your problem will be resolved. Code:JExcelApiExporter excelApiExporter = new JExcelApiExporter(); excelApiExporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint); excelApiExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outputdirectory + reportName + ".xls"); excelApiExporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); excelApiExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE); excelApiExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,Boolean.TRUE); excelApiExporter.exportReport();Post Edited by prani_vel at 07/19/2010 07:32 Link to comment Share on other sites More sharing options...
shanood Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks prani_vel for the update.I tried creating the report by using JExcelApi. The excel file was getting created but while opning it shows the message,"The file you are trying to open is in a different format than specified by the file extension.Verify that the file is not corrupted and is from a trusted source before opening the file.Do you want to open the file now?". When I click on 'yes", it shows a blank file.Please let me know what might be the cause of the issue. Link to comment Share on other sites More sharing options...
prani_vel Posted July 21, 2010 Share Posted July 21, 2010 What is the Jar version you are using ? Try using jasperReports3.5 or 3.6 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now