Jump to content
Changes to the Jaspersoft community edition download ×

Problem with parameter from subreport


llaconde

Recommended Posts

Hello i'm using a subreport in my main report and I get back a sum from this subreport. It is called Somme_Surface_Parcours_2. I have to add this variable to another variable: Somme_Surface_Parcours_1. I need to put this addition in another variable: Somme_Surface_Parcours in which i put this : "( ($V{Somme_Surface_Parcours_2}==null) ? $V{Somme_Surface_Parcours_1} : $V{Somme_Surface_Parcours_1}.add($V{Somme_Surface_Parcours_2}) )"

 

If I try to display this variable, i only get the Somme_Surface_Parcours_1 but if I display directly in a field my expression, it works just fine.

So I really don't understand why something that is working in a field doesn't work in a variable.

Please, help me, I going crazy!!!:woohoo:

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

llaconde wrote:

I still haven't found the solution.
Ideas?

Thx.

 

I have same problem and I resolved problem with directly sum variable in text field (not use variable in master report).

By my opinion maser variable calculate before get variable from subreport and because you have always only one variable added in master report sum variable.

Link to comment
Share on other sites

  • 1 year later...

This is really unfortunate because in many cases you are going to want to use a variable to sum the addition of two subreport variables in the master report. Using the text box technique you can get show the value of the subreport band but you can't perform any summary operations.

Thanks,

bnye

Link to comment
Share on other sites

I should note the scenario would be like this

MasterRep1Var1 =SubRep1Var1

MasterRep1Var2 =SubRep2Var1

 

The following can be done using a text box

MasterRepTextField1 = MasterRep1Var1 - MasterRep1Var2

 

However if you then wanted to sum all of the differenences up for the master report you would not be able to.

MasterRepSum(MasterRep1Var1 - MasterRep1Var2)

 

Sincerely,

bnye



Post Edited by bnye at 09/10/2009 15:57
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...