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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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}='MA I001' AND {AdmFormData.AlphaData}<>' N'
(This formula does not work either)
{AdmFormData.Keyfield}='MA
(This formula does not work either)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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'