Conditional linking from Sub report to the main report

I have a main report which gets account ID (ACID) and and Control ID(CID),along with other fields.
I have a sub-report,which gets me ACID,CID and Eligibility_ID(E_ID).
The subreport should be linked to the main report :
1. On ACID only, when the E_ID = 'N'
2.ON ACID and CID when the E_ID = 'Y'.

How to accomplish this? Please advise.

I'm on Crystal Reports XI R2.
pvsbandiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
You will have to link on both fields then edit the select expert in the subreport to reflect the condition

In the subreport
Click REPORT --> SELECTION FORMULAS --> RECORD

You should see something like
{AccountIdField} = {?pm_AccountId}
AND
{ControlIdField} = {?pm_ControlId}

Edit it to be
(
{AccountIdField} = {?pm_AccountId}
AND
{Eligibility_IDField} = 'N'
)
OR
(
{AccountIdField} = {?pm_AccountId}
AND
{ControlIdField} = {?pm_ControlId}
AND
{Eligibility_IDField} = 'Y'
)

mlmcc




0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PCIIainCommented:
or

{AccountIdField} = {?pm_AccountId}
AND
({Eligibility_IDField} = 'N' or {ControlIdField} = {?pm_ControlId})
0
pvsbandiAuthor Commented:
Thanks! I have some questions here..
   The parameters for the ACID and CID are not there on the report.If i create them, wouldn't users be prompted to fill them? I'm new to the world of crystal reports,so please bear with me.
   
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

pvsbandiAuthor Commented:
OK, i figured it out.Now, my problem is in aligning the subreport data with the main report.
 How can use only selective fields in the subreport to show along with the main report fields?
 I've put the subreport in the details,next to the main report fields and it is showing too many fields and doen't make sense rightnow..please help.
0
pvsbandiAuthor Commented:
Sorry,will ask this as a separate Question.

Thanks much!
0
mlmccCommented:
If you are referringto the ?pm_xxxx fields then no.

Crystal creates parameters to use in the linking of the main report to the subreport and passes the main report values through them.  The parameters are for report use only and th euser will be unaware of them.

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.