Jump to content
Changes to the Jaspersoft community edition download ×

use variable end report value in rec.detail


pmaslov

Recommended Posts

I am running an SQL query in Jasper report and I need to evaluate an expression

 

Foo(field, sum(field))

 

for each record. Problem is that I cannot use SQL to get SUM , I need my Jasper report to calculate it.

 

I made a variable that calculates the SUM. I am able to display the SUM in a Text Filed with Report Evaluation Time.

Now - how do I use SUM in expression evaluated for each record like Foo( field,sum(field)) ?

If it is not possible, then what would be a possible workaround?

 

Thanks!!!!!!

 

Pavel

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If you want to evaluate Foo(field, sum(field)) to display the result in a text field, you can use the "Auto" evaluation type (available since JR 1.2.0). This is the only feature that allows you to evaluate a expression at several points in time (the field should be evaluated immediately, but the sum needs to be evaluated at the end of the report fill).

 

Otherwise, you'd need to somehow (e.g. separate query) compute the sum before iterating the report rows.

 

HTH,

Lucian

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