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

Values off by one in subreport return values


2004 IR Help

Recommended Posts

By: Hugh Blandford - global

Values off by one in subreport return values

2005-04-23 20:45

My report I'm creating is a phone bill. I have a subreport running which adds up the number of calls and the total value of calls per phone line in a sub report.

 

I return this value to the master as per the example in the jasperreports faq area.

 

However, no matter how many times I read it I don't understand how to get the "total" generated.

 

I am currently getting the total from 4 out of 5 lines. It seems that I am summing the values after display rather than before display. If anyone can help or suggest something I would really appreciate it. ie I am adding up the totals of the first 4 lines, with the 5th's subtotal being correctly displayed in the subreport but the total in the summary is only a total of the first 4 lines.

 

I'm assuming that I haven't got the concept of groups understood properly :-(

Any help would be greatly appreciated.

 

 

 

 

By: Denny Valliant - xenden

RE: Values off by one in subreport return val

2005-04-24 00:44

The blind leading the blind, but you should definately look into the 'evaluate' stuff. You can set it to "now" or "report" and a couple of others. You're looking at "report" (after report is generated). Course, you could easily find this out by looking at some of the samples. Evaluate when is an important bit of this project. Or whatever. Could come in handy if you are serious. ;-P

 

Specific sample (i just looked at it myself) is the tableofcontents sample. It has some stuff you'd probably like to look at.

 

HTH, etc.,etc.. =-]

 

 

 

 

By: Brent - bwenson

RE: Values off by one in subreport return val

2005-05-09 06:13

Did you solve this problem? I'm having the exact same problem.

 

 

 

 

By: kootjekip - kootjekip

RE: Values off by one in subreport return val

2005-05-09 07:54

Complain about this missing feature, it is very important that there is an easy way to return values to a master report, don't work around anymore, let them fix it :)

 

 

 

 

By: Teodor Danciu - teodord

RE: Values off by one in subreport return val

2005-05-09 08:10

 

Hi,

 

It depends on where are you actually placing the total

you are calculating inside the subreport.

Is this total diplayed in the master report in the same

section as the subreport itself?

 

As Denny suggested, you should try use the

evaluationTime attribute for the total text field to delay

the display of the value until it is actually completely

calculated.

 

I agree with "kootjekip" that something needs to be done

to simplify the return of values from subreports.

But I'm also open to suggestions about how to do this

since I have not found a better way to structure this.

If you have an idea, let's us hear it!

 

Thank you,

Teodor

 

 

 

 

 

By: Brent - bwenson

RE: Values off by one in subreport return val

2005-05-09 08:31

In my case, I have a subreport in the detail section that is in a group. I also have a variable the summarizes the subreport return values from each record in the group. I have placed a field in the group footer that displays the value of the summary variable. It works great except the value of the last subreport in the group is added to the next group.

 

The text field's evaluation time is now. The variable's reset is on the group. I have tried multiple combinations of evaluation times and can't seem to find one that works.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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