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

SUPPRESS TEXT OBJECT

Status
Not open for further replies.

crdamsel

Programmer
Aug 7, 2013
33
US
NEED TO SUPPRESS A TEXT OBJECT DEPENDING ON 2 PARAMETER FIELDS. IF {?Product} = "T35" THEN DO NOT SUPPRESS BUT IF {?Code} = "F" THEN SUPPRESS. TRIED USING THE FORMULA BELOW IN FORMAT EDITOR CLICKING THE X-2 BUTTON LEAVING THE SUPPRESS CHECKBOX UNCHECKED IN THE COMMON TAB BUT WILL NOT WORK IF {?Code} AND {?Product} HAS DIFFERENT DATA.

if {?Product} = "T35" then
if {?Code} = "F" then TRUE else FALSE

ANY HELP IS APPRECIATED.
 
From what you posted, you are in the right area. Do not check the suppress box, rather just go into the x-2 button and type {?Code} = "F"... No if statement. Any {?Code} value of "F" will be suppressed then.

Good Luck!

FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
THANKS SO MUCH FOR YOUR PROMPT RESPONSE. THE {?Code} = "F" IS A GREAT IDEA HOWEVER I NEED TO NOT SUPPRESS THE TEXT OBJECT IF {?Product} = "T35". SOMETIMES BOTH PARAMETERS ARE {?Product} = "T35" AND {?Code} = "F" AT THE SAME TIME.
 
How about concatenating both fields like this:

{?Product}&{?Code} = "T35F"

FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
EXCELLENT SUGGESTION HOWEVER I NEED TO BE MORE SPECIFIC. IF {?Code} = "F" THEN THE TEXT OBJECT IS SUPPRESSED REGARDLESS IF Product} = "T35" BUT IF {?Code} <> "F" AND Product} = "T35" THEN THE TEXT OBJECT SHOULD NOT BE SUPPRESSED.
 
Your posts are unclear and, I think, contradictory.

You need to approach this in a more logical way. There are 4 possible combinations of parameters. as follows:

[Pre]
1. {?Code} = "F" and {?Product} = "T35"
2. {?Code} = "F" and {?Product} <> "T35"
3. {?Code} <> "F" and {?Product} = "T35"
4. {?Code} <> "F" and {?Product} <> "T35"
[/Pre]
For each of the 4 possibilities, please advise whether the text should or shouldn't be suppressed.

We will then be able to give you a definitive answer to your question. Until then it would be, at best, a guess.

Cheers
Pete
 
Usually raher than doing conditional suppression on a text object, I'll jst replace itwih a formula that either ha the text or spaces, like:

if {?Code} = "F" and {?Product} = "T35" then "Text"
else
if {?Code} = "F" and {?Product} <> "T35" then ' '
else
if {?Code} <> "F" and {?Product} = "T35" then ' '
else
if {?Code} <> "F" and {?Product} <> "T35" then "Text"
else "I missed something"
 
APOLOGIZE FOR NOT BEING CLEAR. HOWEVER IN ANSWER TO pmax9999:

1. {?Code} = "F" and {?Product} = "T35" *** SUPPRESS TEXT OBJECT BECAUSE {?Code} = "F"
2. {?Code} = "F" and {?Product} <> "T35" *** SUPPRESS TEXT OBJECT BECAUSE {?Code} = "F"
3. {?Code} <> "F" and {?Product} = "T35" *** DO NOT SUPPRESS TEXT OBJECT BECAUSE {?Code} <> "F" BUT {?Product} = "T35"
4. {?Code} <> "F" and {?Product} <> "T35" *** SUPPRESS TEXT OBJECT BECAUSE {?Code} <> "F" AND {?Product} <> "T35"

FOR Charliy:

if {?Code} = "F" and {?Product} = "T35" then "Text" *** SUPPRESS TEXT OBJECT BECAUSE {?Code} = "F"
else
if {?Code} = "F" and {?Product} <> "T35" then ' ' *** SUPPRESS TEXT OBJECT BECAUSE {?Code} = "F"
else
if {?Code} <> "F" and {?Product} = "T35" then ' ' *** DO NOT SUPPRESS TEXT OBJECT BECAUSE {?Code} <> "F" BUT {?Product} = "T35"
else
if {?Code} <> "F" and {?Product} <> "T35" then "Text" *** SUPPRESS TEXT OBJECT BECAUSE {?Code} <> "F" AND {?Product} <> "T35"
else "I missed something"

THANKS SO MUCH FOR ALL YOUR HELP.
 
So, do not suppress if F and T35... Then use...

NOT({?Product}&{?Code} = "T35F" )

FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
THIS THREAD IS CLOSED. THANKS TO THE TIPS FROM ALL OF YOU WAS ABLE TO JUST USE THE CODE BELOW TO SUPPRESS MY TEXT OBJECT WHEN IT NEEDED OR DID NOT NEED TO BE SUPPRESSED.

if {?Product} = "T35" then FALSE;
if {?Code} = "F" then TRUE;
 
I WAS WRONG. THE 2 LINES OF CODE THAT I GAVE DO NOT SUPPRESS PROPERLY IF {?Product} <> "T35" AND {?Code} <> "F" HOWEVER THE CODE BELOW WORKS GREAT. THANKS AGAIN EVERYBODY FOR ALL YOUR HELP.

if ({?Code} = "F" and {?Product} = "T35") then SUPPRESS
else
if ({?Code} = "F" and {?Product} <> "T35") then SUPPRESS
else
if ({?Code} <> "F" and {?Product} = "T35") then SUPPRESS
else
if (?Code} <> "F" and {?Product} <> "T35")then SUPPRESS;
 
MADE ANOTHER MISTAKE BUT LAST TIME. ANYWAY, THE CORRECT CODE IS BELOW.

if ({?Code} = "F" and {?Product} = "T35") then SUPPRESS
else
if ({?Code} = "F" and {?Product} <> "T35") then SUPPRESS
else
if ({?Code} <> "F" and {?Product} = "T35") then DO NOT SUPPRESS
else
if (?Code} <> "F" and {?Product} <> "T35") then SUPPRESS;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top