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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking subreport 2

Status
Not open for further replies.

kchaudhry

Programmer
Nov 10, 2003
256
US
Hi, I am using CR 8.5 with SQL Server 2000 backend. I have created a main report and grouped it by Manager ID. Then I have created a subreport for all the people that work this manager and grouped it by the Manager ID too. Now when I try to insert the subreport into the main report's header(inculudes data from main report too) the first page is fine but then the next 5 - 10 pages show me the data for subreport only. So in other words the subreport is running every time with the main report.

Is it possible for me to use a formula and conditionally suppress the unwanted parts of the subreport? Meaning the subreport only displays the records where the Manager ID matches from the main report.

Any help is appreciated.

Kchaudhry
 
Try placing the subreport in the group header or group footer--then only records for that manager will show in each group of the main report. Within the subreport, you can suppress any section you don't want to show on the main report.

-LB
 
LB,

Thanks for a quick response. I have done exactly what you stated. I have placed the subreport in group footer of the main report. It still runs the entire subreport for every Manager id. Here is what my report design looks like.

Main report Grouped on Manager ID:

Group Header:
Regional Total Actuals Goals %Acheived
xxxx xxxx xxxxx
xxxx xxxx xxxxx

Details section is suppressed as I only need the summary.

Group Footer:

Subreport grouped on Manager ID:

Local Total Actuals Goals %Acheived
Long term xxxxx
Short Term xxxxx
Number of days(xxx)

Maybe this might help in understanding what I trying to acheive.

Thanks,

Kchaudhry
 
Forgot to mention that your subreport should be linked to the main report on the manager ID field. I think that should do it.

-LB
 
Can you please tell me how can I link the subreport to the main report on the Manager ID field? I am not sure how to do that. Sorry to be a pain.
Thanks,

Kchaudhry
 
You're not being a pain. In the main report, go to edit->subreport links and choose {table.managerID} from the available fields list and click on the arrow to move it to the right "Fields to Link to" area. The bottom right area "Select data in subreport based on: " should show {table.managerID} also. This should autopopulate, but if not, choose the field from the dropdown. Then click OK.

-LB
 
Try menu items 'Insert/Subreport' - create the subreport from the start, or alternatively if you want to use the existing one you have, save the subreport on its own then open the subreport in the 'Insert/Subreport' 'choose a report' selection. Use the 'link' section to associate the main reports Manager ID field with the subreports Manager ID field, then only the required records should display for that manager.

Hope this makes sense.. btw I'm on v7.5 so this may differ slightly in v8.5, but principal should be the same.

Paul
 
LB,

You were right the linking was creating the problem. Its fixed now.

Thanks a lot for your help :)

Kchaudhry
 
Paul,

Thanks for your input. I have used LB's directions and the problem is solved.

Kchaudhry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top