Crystal formula based on sub report

I have a report and want to base a formatting formula on a field on the sub report.
When I look for the fields I want to add to my formula (from the sub report) they are not available.

Is this even possible?
HKFueyAsked:
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.

peter57rCommented:
No.

The only route you can look at is to pass the value from the subreport to the main report using a shared variable and then test the variable value.

This means the main form formatting must come After (lower than)  the subreport in the design.

 
0
mlmccCommented:
Agree.
FOr example if the report is grouped on a field nd you have the subreport in the group header, then you can format the details and group footer based on a value passed back from the subreport.

Can you give us more information on the formatting you want to use in the main report?

It may also be possible to use a SQL Expression to get the information you need.

Another idea would be to have a User Function (UFL) call that returns the information.

mlmcc
0
HKFueyAuthor Commented:
Hi Guys,
I'm not hopeful, but here is some more info: -

I have 2 report headers one of which I want to hide depending on the result of the sub report. The sub report is a one-liner having Customer Code and a parameter (Email or Post)

Peter: not sure what you mean by: -The only route you can look at is to pass the value from the subreport to the main report using a shared variable and then test the variable value.
0
mlmccCommented:
Where is the subreport?

It will have to be in the first report header and by itself

Report section
RH
   RHA  --  put the DeclareVariables formula (below) here
   RHB  --  put the subreport here
   RHC  --  Your first report header section
   RHD  --  Your second report header

DeclareVariables
WhilePrintingRecords;
Shared StringVar OneLiner;
Shared StringVar EmailORPost;
""

Add the formula to the RHA and the report header in the subreports
Set the shared variables in the subreport as
WhilePrintingRecords;
Shared StringVar OneLiner;
Shared StringVar EmailORPost;
OneLiner := "SomeText or field";
EmailORPost := {?YourParameter};
""

Suppress all sections int he subreport that have no formulas
Use the SUPPRESS BLANK SECTIONS in the section expert of the subreports for the sections with formulas

Format the subreport to have no borders
Format the subreport to SUPPRESS BLANK SUBREPORT - last tab in FORMAT SUBREPORT

Use the SUPPRESS BLANK SECTIONS in the section expert in the main report for RHA and RHB

Suppress RHC and RHD using the shared variables
WhilePrintingRecords;
Shared StringVar OneLiner;
Shared StringVar EmailORPost;
OneLiner = "SomeText"  AND EmailORPost = "Post"

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
HKFueyAuthor Commented:
Thanks for the (very detailed) help!
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.