munga Posted March 4, 2009 Share Posted March 4, 2009 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 mungaPost Edited by ted munga at 03/24/09 10:07Post Edited by munga at 07/02/2009 10:18 Link to comment Share on other sites More sharing options...
munga Posted March 21, 2009 Author Share Posted March 21, 2009 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 -100or./run_test.sh 100 Link to comment Share on other sites More sharing options...
itchytoes Posted April 7, 2009 Share Posted April 7, 2009 Hi -- I tried your test program. I got red display for -100 and black display for 100. I am using jasper reports 3.1.3 though Link to comment Share on other sites More sharing options...
munga Posted April 13, 2009 Author Share Posted April 13, 2009 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.ThanksMunga Link to comment Share on other sites More sharing options...
lucianc Posted May 11, 2009 Share Posted May 11, 2009 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 More sharing options...
munga Posted July 2, 2009 Author Share Posted July 2, 2009 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"/>ThanksmungaPS 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 More sharing options...
lucianc Posted July 3, 2009 Share Posted July 3, 2009 mungaWrote: 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 More sharing options...
anjalisaxena Posted May 17, 2013 Share Posted May 17, 2013 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 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