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

Conditional suppression weirdness 1

Status
Not open for further replies.

sofseattle

Technical User
Dec 2, 2004
12
US
Hi All,
This one has me stumped. I have a SAP Business one print layout that should work for 2 locations. For the Logo and for the company address, I have conditional suppression formulas that should show logo and address 1 if it is warehouse x and logo and address2 if it is warehouse Y. Here is what I CANNOT figure out for the life of me. Page 1 of the document it works great, page 2 both logos and addresses are showing. There are located in the page header section of my print layout.

Here are my formulas:

Logo and address 1
if {INV1.WhsCode} = '04D1'
OR {INV1.WhsCode} = '04D1S'
OR {INV1.WhsCode} = '05D1'
OR {INV1.WhsCode} = '05D1S'
then true


Logo and address 2

if {INV1.WhsCode} = '01D1'
OR {INV1.WhsCode} = '01D1S'
OR {INV1.WhsCode} = '02D1'
OR {INV1.WhsCode} = '02D1S'
OR {INV1.WhsCode} = '03D1'
OR {INV1.WhsCode}= '03D1S'
then true

Any help would be GREATLY appreciated.

Thank you
 
Just as a general rule in something like this. I would always put an ELSE False. That way it would always be a True or False, not a True or Null. The only thing I can think of for debugging is to display the results of each formula at the same spot where the logo is displayed (you will need to create two new formulas). Thus you can be assured that formula is returning the value you are expecting.
 
The page header will pick up whatever value is in the first detail row of the page. Just to see that this is so, place the whsCode field in the detail section. This means your formula is will be testing that first value only. If you are grouping on location, you should format the group footer with: New Page After->x+2 (no check mark) and enter:
not onlastrecord. This will fix your issue and also prevent a new page at the end of the report.

Just to clarify, the default value if not true is false and it is not necessary to specify. However, if a suppression formula hits a null in the field it is testing (whscode), a checkmark in the suppression box will override the formula in the x+2 formula area (if you have not checked for nulls in the formula), so whether or not you check it depends upon what you want to happen if the whscode field is null. I ordinarily never check the box if I am using a conditional formula, but there might be an occasion when you would want it to work that way.

You could also simplify your formula to:

{Inv1.whscode} in ['01D1','01D1S', etc.]

-LB
 
Quote: Just to clarify, the default value if not true is false and it is not necessary to specify. However, if a suppression formula hits a null in the field it is testing (whscode), a checkmark in the suppression box will override the formula in the x+2 formula area (if you have not checked for nulls in the formula), so whether or not you check it depends upon what you want to happen if the whscode field is null. I ordinarily never check the box if I am using a conditional formula, but there might be an occasion when you would want it to work that way.

Odd I was under the assumption that a formula always overrides the checkbox. At least that is what I observed.
 
The formula doesn’t execute if it hits a null (and there is no null check), so the check mark then becomes the default. I noticed this first when using formulas using next/previous. If there is no previous record (null), if there is a check, the first record will be suppressed; if no check mark, it will not be suppressed.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top