Jump to content

Where are my subreport variables?


gmohdez

Recommended Posts

Hi,

 

I have a pretty weird situation:

I've created my subreport which uses a variable to asign values depends on certain results of the query. At this point all works fine, but when I try to bind my main report's variable with this subreport's variable in the return values dialog, the last ones does not appear in the list "subreport variable"! Just appear the default variables from the subreport.

Some specs:

Subreport variable

name=VFACTURADO

class=java.lang.String

calculation=nothing

reset type=none

variable expression=($F{NFACTURAS}.intValue()> 0 ? "S" : "N")

initial value expression="N"

Main report variable

name=VFACTURADO (the same from subreport)

class=java.lang.String (the same from subreport)

calculation=nothing (the same...)

reset type=none (the same...)

variable expression (empty)

initial value expression (empty)

Subreport works fine, I've put it in the main report and show results (into the subreport) when run in JasperReports Viewer, but I can return it's variable to my main report.

I've followed up the very step by step instructions to return values from subreports explained in iReport3.7 book, but nothing.

I've tried to change reset type in both variables, making "test & fail" and no matter what, the name of the variable doesn't appear in the list.

I've even tried to type manually the variable's name, but doesn't work, just print "null", obviously because this variable name doesn't recognized by the main report.

I hope this info will be enough and anyone could reply to my ask. It's very urgent to me.

I'm starting to think that is a BUG!!!

Any suggestion? I'm using latest iReports version (3.7)

Thanks in advance



Post Edited by gmohdez at 08/05/2010 18:11
Link to comment
Share on other sites

  • 1 month later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I assume that you are using the iReport designer.

The iReport doesn't catch the variables defined in a sub-reports. So, these variable names have to be manually typed in the master report in the returned values dialog.

I also tried returning values from the sub-report to the main report, but it was always showing the value to be null even when the evaluation time of the text field was set to "Report". It appears certainly a bug to me.

 

Link to comment
Share on other sites

  • 3 months later...

In the main report the calculation type of the receiving variable must be set to 'system'.

I have a different problem: the main report variable content is not the value assumed in the currently calculated subreport but the value assumed in the precedent calculation.

So if the subreport variable assumes the values:

1, 2, 3...

in the main report I have

null, 1, 2...

Can't understand why...

 

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