Crystal Reports Xi
I have a Sales Analysis Report that generally works fine but it doesn't sort properly. Apparently, I am getting the Sections by the field of Company Sales Rep [Company.SalesRepID] and not the field of Opportunity Sales Rep [Opportunity.SalesRepID].
Schema (generally):
Company:Contacts => 1:Many [Company table has a SalesRepID field, as does the Contact table]
Company:Opportunities => 1:Many [Opportunity table has a SalesRepID field which defaults from the Company table but can be is changeable by the Sales Rep]
Contacts:Opportunities: => 1:Many
Opportunity:OpportunityJob => 1:1
User table has fields: UsersID with their Firstname, Lastname (for SalesRep and other users)
Crystal Report structure:
Group Header #1 (Lastname, Firstname from @RepName from Users table)
Group Header #2 OpportunityJob Create Date [OpportunityJob.CreateDate]
Group Header #3 OpportunityID [Opportunity.OpportunityID]
Detail
Crystal Report output:
When I run the report I'm getting the Section 1 output correctly sorted by User table entry Lastname&Firstname. That is, sales rep lastname, firstname like Adams, John then Burton, Richard then Cheek, David then Davis, Lee etc.
Here's the general CR layout after the page headers:
Group Header #1 : Doe, John
Group Header #2: is suppressed
Group Header #3: is suppressed
Detail : Date Sold Job# Account Contact Sale Amount
The SalesRep (Doe, John) fields are being extracted and sorted correctly from the User table. I want to sort on the OpportunityJob.JobNumber in ascending order for each record that is associated with the Group Header #1 SalesRepID. [Note: There is a SalesRepID field in the Opportunity table (Opportunity.SalesRepID] that contains the SalesRep internal key so I could select/filter on this Opportunity.SalesRepID field and then sort the OpportunityJob.JobNumber field. Links appear to be setup fine.
How do I do this?
So, what am I doing wrong (or not doing!)?
What I currently see is the correctly sorted SalesRepID by lastname&firstname and then an improperly sorted JobNumber field (column) in the report as well as this JobNumber field NOT having the correct sales rep's initials to indicate that the job is his job. That is, the JobNumber report column has a mixture of JobNumbers that don't correlate with the SalesRep's Lastname&Firstname from Section 1.
TIA