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
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
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