×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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?

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

Just a quick question. Is the parameter ?Sales Rep is part of the selection criteria in the subreport?

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

(OP)
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})

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

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

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

(OP)
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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close