Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Subreports 1

Status
Not open for further replies.

nb4884

IS-IT--Management
Aug 2, 2010
141
US
Hi All,

I have 5 subreports. My main report has 7 parameters and these 5 subreports are inserted in the main report.

An ex of one of my main report params is :
(If ({?Project} = '' or {?Project} = '0')
Then 1=1
Else{Query1.Project Id} = {?Project})

Need a suggestion on how do I link all the 5 subreports to the main report. I need data from subreports based on the parametrs chosen in the main report Do I have to create all the 7 params in the 5 individual subreports? If so what should be the formula for selection criteria with in the subreport.

Thanks

 
Is the main report just a container report, with all five subreports in the report header or report footer section? If not, please explain in what report section the subs are located.

-LB
 
Yes the main report is only the container , however I am just displaying Project Name and PM in Main report in the Details A section also main report is grouped by ID

The other 5 Subreports are in also in the details section
Subreport 1 and 2 are in Details b , placed end to end
Subreport 3 is in details c
Subreport 4 and 5 are in Details D placed as one on the top and other beneath it

I have created 7 parameters on the main report with an example as one of the param as shown above. All the other 6 params are in similar code except that the fields change.

Now I have created all the same 7 params in each of the 5 subreports. And coming back to Main report I have linked these subreports as ?project = ?pm-?project etc

Now each subreport selection criteria shows (Taking only 1 param as an example):

{Query1.Project} = {?Pm-?Project}

If I choose a particular project , it shows data for that project in a way I want and all the subreports data shows well placed in one page. But if I choose 0 or "" this shows no results.

I then manually modified it to
(If ({?Pm-?Project} = '' or {?Pm-?Project} = '0')
Then 1=1
Else{Query1.Project} = {?Pm-?Project})

It does show me all the projects but the linking doesnt seem right and data is all over many pages. the subreports are scatted on different pages and there are multiple pages.

Please let me know what am I doing wrong here.

Thanks

 
In the subreport linking screen, use the dropdown to select {?Project} instead of the default {?pm-?Project} and link to that instead. Then make sure your record selection formula in the subreport uses the if/then criteria. If you are grouping on ID, I would guess you also need to add a link on ID for each sub.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top