Jump to content
We've recently updated our Privacy Statement, available here ×

Total and current row number with $V{REPORT_COUNT}


opklop

Recommended Posts

Hi all,

In ireport but without using scriptlet, i am trying to compare in a chart filter expression the current row number with the total row number.

Indeed, I need to print in a barchart the 5 first rows and 5 last rows of a random size datasource (no possibility to manipulate the data before)

The idea is to compare the current row number with the total row number. For that i am using the REPORT_COUNT variable and the evaluation time expression but that way i have either the total number or the current row number. I can't have in the same expression the current row number and the total row number.

Does someone know a solution for that ?

Thank's a lot

 



Post Edited by opklop at 06/16/2011 04:56
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If I'm understanding you correctly--I don't think what you're trying to do is possible due to the calculation time...Since Ireport won't know the total row count until the end of the report, you won't be able to show that total within the detail band.

 

David

Link to comment
Share on other sites

Thank for the participation.

Perhaps more possible, knowing the number of row before the evaluation of a chart, is that something possible ? i would like to print or not some data depending of the total number ...

Someting like for the table of contents with the textfield and evaluation time.

 



Post Edited by opklop at 06/16/2011 15:16
Link to comment
Share on other sites

Hi all,

i can now retrieve the number of rows before printing my chart but i dont really understand the way jasper is working with variable initalisation.

In my example i work with a 4 records datasource. I created a variable with a Reset Type on "Report" which count the number of rows. The chart is a simple barchart with and evaluation time on "Report".

When i use the "print when expression" on the chart, the variable has the correct value (4) because it's a "None" Increment Type. But when i use the same variable in the filter expression or in the category series expression of the same chart, the variable has  been been reinitialized to 0 and the count is done again, following the iteration of the datasource (1, 2, 3, 4).

Like i used the reset type "report" for the variable i would have thought that my variable would'nt have been reinitialized. If i print a simple textfield on my count variable in the detail band i can see the value incrementing. And again in the chart the incrementation is done again ...

Hope it's comprehensible :)

Thank's a lot



Post Edited by opklop at 06/17/2011 05:26



Post Edited by opklop at 06/17/2011 05:29



Post Edited by opklop at 06/17/2011 05:30
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...