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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditionally suppress section

Status
Not open for further replies.

gegeying

Programmer
Feb 22, 2007
14
US
hi, anyone can help me on this?

I have several formula: @error1, @error2,... @error4. The report use those formula to evaluate the data.

In detail section, there are good and bad data. If the data is bad, value from the corresponding error formula will show up. For Example:

WO[tab]DATE[tab]LABOR[tab]TOOL[tab]MATERIAL[tab]ERROR
1[tab]10/02[tab][tab]$120[tab][tab]$40
2[tab]10/12[tab][tab]$200[tab][tab][tab][tab][tab][tab][tab][tab][tab]1
3[tab]11/02[tab][tab][tab][tab][tab][tab]$80[tab][tab][tab][tab][tab][tab]2
4[tab]10/21[tab][tab]$300[tab][tab]$250
5[tab]11/10[tab][tab][tab][tab][tab][tab][tab][tab][tab]$300[tab][tab]4


On the report, I'd like the good data to be suppressed, only showing those bad. Right now, what I did is in Section Expert, I conditionally suppress detail section. The formula to suppress is as below

@error1 <> "1" and
@error2 <> "2" and
@error3 <> "3" and
@error4 <> "4"


However, it partially work. some bad data also got suppressed. Can anyone help? I am using Crystal 8.5


Thanks
 
What is the value of an error formula if it does not find an error? If it's null, then it could be a problem.

Put an alternate value for false in all of your error formulas, something along the lines of:

IF (..) THEN "1" ELSE "0"

then make your Suppress formula

{@error1} = "0" and {@error2} = "0" . . .
 
Thanks, Charliy.
I did as you said, put "0" there. However, the report still hide some of the bad data.

any idea?

Thanks
 
I have used the following formula in the X-2 with the section suppressed

if not({@error} in ["1","2","3","4"]) then
true
else
false
 
Please show the content of a couple of your formulas.

-LB
 
[blue]Here is the contents of some error formular.[/blue]

ERROR2
IF {WORKORDER.WORKTYPE} = "CONTRACT" and ISNULL ({WORKORDER.WO14}) then
"2" ELSE "0"


ERROR4
IF {@NoError4} = "Error_4" AND
{WORKORDER.WO20} <> "Y" AND
(
{WORKORDER.WORKTYPE} in ["SHA","INMATE"] AND
(
( {WORKORDER.ACTLABCOST} > 0.00 AND {WORKORDER.ACTTOOLCOST} = 0.00 ) OR
( {WORKORDER.ACTLABCOST} = 0.00 AND {WORKORDER.ACTTOOLCOST} > 0.00 )
)
)
THEN "4"
ELSE "0"

ERROR9---including several errors
IF {WORKORDER.WO20} <> "Y"
AND
{WORKORDER.WO6} = 0.00
AND
( ISNULL({WORKORDER.WO14}) = false
OR
{WORKORDER.ACTLABCOST} > 0.00
OR
{WORKORDER.ACTTOOLCOST} > 0.00
)
Then "3"
Else
IF {WORKORDER.WORKTYPE} <> "CONTRACT"
AND
{WORKORDER.ACTMATCOST} = 0.00
AND
{WORKORDER.ACTLABCOST} = 0.00
AND
{WORKORDER.ACTTOOLCOST} = 0.00
Then "5"
ELSE
If ISNULL({WORKORDER.WO14}) =false AND {WORKORDER.WORKTYPE} = "SHA"
Then "7"
ELSE "0"

[blue]THANKS[/blue]
 
I guess you have these formulas overlaid on each other? Try a detail section suppression formula like this:

{@error1} = "0" and
{@error2} = "0" and
{@error3} = "0" and
{@error4} = "0"

If this doesn't work, try:

{@error1} in ["","0"] and
{@error2} in ["","0"] and
{@error3} in ["","0"] and
{@error4} in ["","0"]

-LB

 
The report is still no working, even though I did as below
{@error1} in ["","0"] and
{@error2} in ["","0"] and
{@error3} in ["","0"] and
{@error4} in ["","0"]

HOWEVER, if I changed the formula order, for example,

{@error3} in ["","0"] and
{@error2} in ["","0"] and
{@error1} in ["","0"] and
{@error4} in ["","0"]

Some error hidding before start to show up.

anybody knows why?

Thanks.
 
I wonder whether you have some other fields that are null. Try writing formulas like this:

isnull({@error1})

Place these in the detail section and see if any of them evaluate as true. If so, you need to do null checks for other fields within each formula.

-LB
 
Thanks lBass.

I went to check all the related fields. guess what, it just like what you said, some showing null and that fails the formula. Now, my report works perfect.

thanks again for your help.

Happy a nice day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top