darelrex Posted September 16, 2010 Share Posted September 16, 2010 I have a Jasper report in which each subreport takes up a whole number of pages (1 or more pages). There is no way for me to know how many pages each subreport is going to take -- Jasper figures that out when it compiles the report.In the header of every page, I need to display some information that is relevant to the subreport that is shown on that page. The only way to do this, as far as I know, is to create a field in the header and populate it with a condition like this:$V{REPORT_COUNT}.intValue() == 0 ? "aaa" : $V{REPORT_COUNT}.intValue() == 1 ? "bbb" : "ccc"That should cause the header to show "aaa" for all pages of the first subreport, "bbb" for all pages of the second report, and "ccc" for all pages of the third (last) report.My problem is that REPORT_COUNT is not delivering the correct value. It seems to be giving the number of subreports that had been accessed before the current page started processing. So I get something like this:Page 1 (report A) --> REPORT_COUNT is 0Page 2 (report A) --> REPORT_COUNT is 1 (problem)Page 3 (report B) --> REPORT_COUNT is 1Page 4 (report C) --> REPORT_COUNT is 2Has anyone else encountered this problem? Is there a known solution? Thanks very much in advance. Link to comment Share on other sites More sharing options...
dhayal.cbe Posted March 1, 2014 Share Posted March 1, 2014 Hi There,We found that this is the actual behaviour of the REPORT_COUNT variable. See the below definition of REPORT_COUNT.REPORT_COUNTAfter finishing the iteration through the data source, this report variable contains the totalnumber of records processed.As per the above definition, the report_count will be calculated after the iteration through each row 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