Jump to content

Problem while running jasper report in excel


shanood

Recommended Posts

 

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...