Jump to content

sub-report not working when sub report parameter is linked with a main report's field


dprogrammer

Recommended Posts

Dear Folks,

I've spend almost whole day today in trying to figure out what I am doing wrong. I would really appreciate if someone could point out where I am doing wrong. 

I've a main report and two sub reports. 

Main report: Group1 on ORGID field. That ORGID field is then passed as a parameter to $P{subORGID} parameter for both subreports. First sub-report is a details report, it's in Group1 footer band, and prints data for each ORGID on a separate page. That part is working fine. 

The second sub-report is with grand totals for each ORGID. Hence I've placed it in Summary section of the main report. I've also linked that sub-report with main report's field $F{ORGID}  = $P{subORGID}. For some reason the subreport is not able to get all ORGIDs in the parameter and is not returning any rows. If I only run the main report for one ORGID, say specifying in WHERE claues ORG.ORGID='1001', the grand total sub-report works fine and brings back data for that ORGID. But when I remove the WHERE clause and want to see all ORGIDs, the grand total sub-report just comes blank. 

Should I change the type of $P{subORGID} to a collection etc.? Or I am missing something? 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Sorry, here is more details: 

Main report sample data: This report pulls all ORGIDS for a given date.

ORGID: 1001

EAST REGION    

                 2016/01/01         $5000

                2016/06/15         $4000

WEST REGION

                2016/05/31         $3000

                2016/06/12         $2000

ORGID: 1002

EAST REGION    

                2016/02/01         $1000

                2016/05/15         $1500

WEST REGION

                2016/05/01         $6000

                2016/06/13         $4000

 

This is how the Grand total report should like for ORGIDs 1001 and 1002.

ORGID                                  Total Sales

1001                                       $14000

1002                                       $12500

 

But it does not seem to get ORGID value from main report correctly. It only works when I hardcode main report for either ORGID=1001 or 1002 and shows grand totals for only one ORGID. But when I run the main report for all ORGIDs the grand total report just comes up blank.

ORGID                                  Total Sales

null                                         null

 

 

Link to comment
Share on other sites

  • 1 year later...

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