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

Subreports showing all sales reps instead of the same sales reps on the main report 1

Status
Not open for further replies.

grpeachtree

Technical User
Sep 5, 2012
7
0
0
I am using Crystal Reports 2008 with Peachtree Premium 2012, a PSQL database engine.

I created a report with 2 subreports.
The main report lists the sales reps and the total sales for each sales rep.
Subreport 1 and 2 are copies of the main report.
The main report shows the total sales for 3 months.
Subreport 1 shows the total sales for 6 months.
Subreport 2 shows the total sales for 12 months.

Tha main report has two parameters:
?Start Date
?Sales Rep

The subreports show all sales reps even when the main report selects only 3 sales reps.
Here is how I linked the subreports:

Field(s) to link to:
?Start Date
?Sales Rep

?StartDate field link
Subreport parameter field to use:
?Start Date

The "Select data in subreport based on field:" is grayed out

?Sales Rep field link
Subreport parameter field to use:
?Pm-?Sales Rep

The "Select data in subreaport based on field:" is checked and
Employee.EmployeeName is selected as the data field

The main report displays the correct sales reps.
The subreports show all sales reps, but should show only those selected in the main report.

How can I fix this?

 
Just a quick question. Is the parameter ?Sales Rep is part of the selection criteria in the subreport?
 
Yes, ?Sales Rep is part of the selection criteria in the subreport.
For example in Subreport 1, the selection criteria is:

{Employee.EmployeeName} = {?Sales Rep} and
{JrnlHdr.JrnlKey_Journal} = 3 and
{JrnlHdr.TransactionDate} >= {?Start Date} and
{JrnlHdr.TransactionDate} < dateadd("m",6,{?Start Date})
 
Use the dropdown in the lower left to select {?Sales Rep} not the default ({?pm-?Sales Rep}. Link this to the same parameter {?Sales Rep} created within the sub.

-LB
 
LB:

Your solution worked perfectly! I needed to use {?Sales Rep} as the Main Report field to link to and as the Subreport field to use.

Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top