Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress formula if condition true 1

Status
Not open for further replies.

Alcar

Programmer
Sep 10, 2001
595
US
I have 4 formulas that display a chekmark (letter "a" with webdings font) if different condition are true.
I am trying to make the first three formulas invisible if the last one is true.

formula 1:{@DTP1}
suppress formula [crystal syntax]:
{@DTP4} = "a" or {@DTP3} = "a" or {@DTP2} = "a" Daren J. Lahey
Just another computer guy...
 
I was saying lol:

formula 1:{@DTP1}
suppress formula [crystal syntax]:
{@DTP4} = "a" or {@DTP3} = "a" or {@DTP2} = "a"

formula 2:{@DTP2}
suppress formula [crystal syntax]:
{@DTP4} = "a" or {@DTP3} = "a"

formula 3:{@DTP3}
suppress formula [crystal syntax]:
{@DTP4} = "a"

this doesn't work!
the 4 formulas are like:

formula @DTP4 [basic syntax]:

if {field1} <> DateValue(&quot;1/1/1900&quot;) then
formula = &quot;a&quot;
end if

thanks in advance Daren J. Lahey
Just another computer guy...
 
well try a couple of things:

1. Put &quot;WhilePrintingRecords;&quot; as the first statement of all formulas involved.

2. Depending on where these formulas are located....there may be evaluation time issues. So you might try using EvaluateAfter(<formula>) in the suppress formula as well

so for :{@DTP1}

WhilePrintingRecords;
EvaluateAfter({@DTP4});
EvaluateAfter({@DTP3});
EvaluateAfter({@DTP2});

{@DTP4} = &quot;a&quot; or {@DTP3} = &quot;a&quot; or {@DTP2} = &quot;a&quot; ;
Jim Broadbent
 
nothing yet Jim, but thank you so far.
Reading in your reply &quot;Depending where these formulas are located...&quot;
Well all the formulas and relative fields are located in a report that then I use as a sub-report. I don't think this would change things much since the subreport has it's own idividual datasource on which the formulas are evaluated, but again I might be missing some knowledge here.


Daren J. Lahey
Just another computer guy...
 
I think what Ngolem was getting at was where in the report are the fields placed? Are DTP1 through 4 all in the details section for example, or different sections each?
 
Yes Naith,
they are all in the detail section. Sorry about my missunderstanding. I've never had to get so much into Crystal Reports in my career until now and it gets confusing sometimes... Daren J. Lahey
Just another computer guy...
 
Alcar,

When you say the formulas don't work, could you give an example of what's happening? Because when I run your formulas pretty much as they are, I get the staggered suppression that you describe.

Naith
 
Actually they work great, after I figured out that every time I change something in the subreport I have to delete it and re-insert it in the normal report before launching my application, so I can see the changes.
Thank you both for your attention on the matter.
Daren J. Lahey
Just another computer guy...
 
Hmmmm you never mentioned a subreport before....are any values passed back and forth via shared variables.

If so the subreport must be run first (usually in a subsection before needed) in order for the variables to be refreshed. Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top