Jump to content
Changes to the Jaspersoft community edition download ×

subreport return value


gombs

Recommended Posts

Hey,

 

I want to work with $V{REPORt_COUNT} from my subreport , I create a variable and returned it. But it works only when I printed it in summary or title or anything, I wantend to print it in detail under the subreport ( fillig is horizontal ) why it not works?

 

Ok I dont want to print it realy I wanted to use in my second subreport, also I wantend to get it from first subreport and give this value to my second subparameter as parameter...it doesn't works :-((

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 months later...
  • 2 months later...

I have similar problem with returning report_count.

I have subreport in band, and subreport is returning REPORT_COUNT. I want this variable use for band print expression, only print it when there are any records.

But in time when this expression is executed this variable is null.

Return variable has set calculation type to system and reset type as report. This variable can be used in others bands with correct value, but I need it in actual band containing subreport.

Link to comment
Share on other sites

smiscik wrote:

I want this variable use for band print expression, only print it when there are any records.

 

This will not work since the print when expression is evaluated before the subreport is filled and the value returned from it.

 

Regards,

Lucian

Link to comment
Share on other sites

Thanks

Have any idea how can I get similar functionality?

Scriptlet?

I need it for reports with DB and XML data source. (they are not both in one report)

 

EDIT1:

with XML data source I made field which count desired elements

Code:
count(/xy).

Now I must make up something to get number of records from DB.

Post edited by: smiscik, at: 2007/08/02 11:46

Link to comment
Share on other sites

Well, the DB equivalent of XPath count(..) is a select count(*) .. which you would execute via the report's scriptlet (or other utility classes). I'm afraid that there's no other solution since the the subreport query gets executer after the band's print when expression is evaluated, so it's not possible to use the result of the subreport query in the parent's band print when expression.

 

Regards,

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