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

[SOLVED] Conditional Style evaluation time


munga

Recommended Posts

Hi All,

I have a master report and a subreport, the master report has a textField in the column header (eval time is report) and a conditional style sets the foreground red if $v{value} is negative. The subreport populates the master report's $V{value}. The problem is that the conditional Style seems to be evaluated before the subreport returns the value, therefore the textField is always the default colour.

I have also tried this with 2 different textfields using the printWhen expression, with the same result.

I have looked at trying to chagne the font in a scriptlet but from iReport it looks like the only Objects that are visible are the data ones.

Any ideas?

Thanks munga



Post Edited by ted munga at 03/24/09 10:07



Post Edited by munga at 07/02/2009 10:18
Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

I still don't have a solution to this problem.

I've included an example to better explain the problem.

To run the example first change the classpath in run_test.sh to your lib files then run

./run_test.sh -100

or

./run_test.sh 100

Link to comment
Share on other sites

  • 3 weeks later...

Hey itchytoes, are you sure you're looking at the right number? I am trying to get the top number to turn red if it is a negative. The conditional style works if the text field is after the subreport call but not before it.

I was using 3.1.4 but I did try using 3.1.3 to see if it changed anything but it didn't for me. I also tried the current 3.5.0 with the same result.

Thanks

Munga

Link to comment
Share on other sites

  • 4 weeks later...

A solution for this has been checked into the JasperReports SVN trunk (rev. 2776).  The engine can now be instructed to perform conditional style evaluations at the moment at which the element is evaluated.

This is not the default behaviour thoug for backward compatibility reasons.  The net.sf.jasperreports.style.evaluation.time.enabled property needs to be set to true globally (in jasperreports.properties), at report level or at element level in order to have delayed conditional style evaluation.

You can test the fix by buiding a JR jar from the SVN sources.  Any feedback is welcomed.

Regards,

Lucian

Link to comment
Share on other sites

  • 1 month later...

 

Thanks for the fix Lucian.

It was very easy to add the fix, all I had to do was add the following line at the report level of the file.

<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/>

Thanks
munga

PS I've been trying to reply to this post for about a week now via firefox with no luck, if this works it will be from ie7

Link to comment
Share on other sites

munga
Wrote:

PS I've been trying to reply to this post for about a week now via firefox with no luck, if this works it will be from ie7

That's strange, I've been using Firefox 3.0 all the time and I did have problems posting.  You can log a bug on JasperForge at jasperforge.org/projects/jasperforge/tracker/myview (or post a note on the forums of the same project).

Regards,

Lucian

 

Link to comment
Share on other sites

  • 3 years later...

Hi Lucian,

Making the net.sf.jasperreports.style.evaluation.time.enabled = true works only if it is run report. If we schedule report the same is not working. Any work around for the same. I need this thing working deadly for schedule report. I am using Jasper 5.0 version.

Appreciate your quick reposnse for the same.

Thanks,

Anjali 

 

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