views:

491

answers:

3

I am having an issue with JasperReports I can not solve. I am using Eclipse, OpenReports 3.2 and IReport 3.7

The issue I am having is that the report does nothing. When I preview the report in IReport I can at least get a "Document has no pages" message but when I try to open it using OpenReports it doesn't do anything. I get the open reports header and the copyright message but nothing between them.

I was able to track it down to line 150 in ReportRunAction.java in OpenReports. That line is:

jasperPrint = jasperEngine.fillReport(reportInput);

At least that is the line the page dies on. It trips the catch block that the line is inside of but the error is empty. When I try to print the description it is null. I can't swear that the issue isn't that parameter. Through looking around all I have been able to find is something about how the report needs to be compiled with the same version of the jasperreports.jar that OpenReports uses. I have no idea how to tell if/what version of jasper reports is being bundled into the .jasper file though.

Is that my problem? If so how do I tell/set the version of the jar that gets bundled? If not; help!

A: 

If you are using the Detail Bandeport, then you will need a Data Query for the report. Since it's returning "No Pages" in iReport, then you either don't have a query. Or simply your query is not returning any rows.

In old iReport, from Data menu, choose Report Query and write your query here. If you want only one record (i.e. Detail band only one time) you can use a dummy table. Like:

SELECT 'a' FROM DUMMY

Otherwise, if you don't want to use the Detail Band, you have the option to view the other bands without using a query. From Edit menu, choose Report Properties, under More... tab, set the flag When no data to All Sections, no detail

Your problem is not exceptions or errors, it's just no data to show.

medopal
I think you misunderstand. I know the report works because it is running on the live server. I am trying to set up a development environment on my computer. I am fine with getting no pages in iReport because that means it IS working and I just need different filter critera or something. My problem is when I run it through OpenReports it doesn't do anything.
William
In that case, im not sure, but since you are saying it catches an exception with no error, that could be a bug in OpenReport.
medopal
A: 

I face pretty much the same problem!!i know that the problem lies with

jasperPrint = jasperEngine.fillReport(reportInput);

but i am not able to see what the error is.

I am able to generate reports in netbeans platform,

but when i integrate the same code with GWT, there is some problem with the line pasted above.Its not able to compile the .jrxml file into a .jasper file. Please help

bhargava
A: 

I ran into the same error when using IReports when I had a subreport that only contained other subreports and no actual query. Adding a dummy query as medopal suggests fixes the 'no pages' error and allows things to run correctly.

See also: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=49315

Greg Miller