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

Recommended Posts

Hi to All,

in My  Table report, i would formatting my cell with a conditional formula,
then I create a Style with 2 condition   (over the Average, under the average)
and in the expression editor I insert   the formula [ new Boolean($F{field_1}>$V{avg_field_1}) ]

where $V{avg_field_1} is calculated as average of  field_1

but the cell is not colored, and I realized that the variable $V{avg_field_1}) is calculated only at the end of the table 

is possible that..??

thanks Max

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Max,

 

You can try to configure "Evaluation time" property for a text field within a Table cell. By default the evaluation time is set to Now, but you can change it to Band or Report. This will force the cell to be generated correspondingly at the end of Band or Report render time.

 

If this results into incorrect values being returned by table cells, then i can suggest to pre-calculate the $V{avg_field_1} variable using subreport. Subreports are being executed before the main report, so the idea here is that you will have the varialbe calcualted in subreport, return the value to the main report and then use this value in conditional expression. You can find detailed info in "17.3 Returning Values from a Subreport" section of iReport Ultimate Guide available under the Docs section:
http://community.jaspersoft.com/documentation?version=13758

Keep in mind that the conditional expression should be in a different band from subreport, otherwise it will be calculated before the variable is returned from subreport.

 

- Stas

Link to comment
Share on other sites

Hi Stas,
I've tried how you explain me.
I have created a subReport and then I inserted the subreport in the main Report...
but I haven't the expected result....
in the subReport i have the sub_var1 , when I insert the the subreport in MainReport I map the sub_var1  with a variable  
created in MainReport main_var1
then to pass the main_var1 to the TableDataset, I create a Parameter and associate this Parameter  with main_var1 
but when I use this parameter in table or i use for create the consitional style for formatting the cell of the table
the value is ever NULL..
the subreport is in the TITLE BAND and the main report in DETAIL BAND , I've tried to change band but it was useless....
Can you give me a little help..

Thank Max

 

 

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