Link to home
Start Free TrialLog in
Avatar of MrWeen
MrWeen

asked on

Record Selection in Crystal Reports

I am having issues with getting the correct parameters to print in Crystal Reports.  Here is some sample data.

Table: Customer

Number        Name
123               Pulleys
456               Bobbys
789               Tommys


Table: ExtraCustomerData


Number     Keyfield     AlphaData
123            HOR001          W
123            MAI001           N
123            BIN001            3
456            HOR001          W
456            MAI001           Y
456            BIN001           4
789            HOR001         H
789            MAI001           N
789            BIN001           6

These two table are connected by the "Number" field.

I have it setup in record selection that Keyfield='HOR001'

This work fine as it is only printing the  information from the HOR001 line and not the other 2.  But now I want to further restrict record selection by only printing the HOR001 record if MAI001='N'.  

How do I do this?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 13Shadow
13Shadow

You need the MAI001 records to determine whether a record is printed or not so you will need to start by changing your record selection to Keyfield='HOR001' or Keyfield='MAI001'.
Then you need to sort your records by Keyfield descending so you get your MAI record before your HOR record. Then create a group by Number and hide the group header as well as the detail lines. In the group footer under suppress enter the formula  MAI001<>'N'.
This will only display HOR001 records where MAI001 = 'N'
Avatar of MrWeen

ASKER

I'm getting an error when i try and use MAI001<>'N' in the footer suppression.  Don't I need some formula like

{AdmFormData.Keyfield}='MAI001' AND {AdmFormData.AlphaData}<>'N'

(This formula does not work either)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial