Conditional Page Header
Will Crystal Reports have a page header that will hide if a condition is not met or viceaversa? If so how is this done?
Example: If Company_Name = 'xyz' then unhide page header A
thanks in advance
cg
[233 byte] By [
mintz87] at [2007-11-20 11:38:34]

# 1 Re: Conditional Page Header
Instead of hard coding the header,write a formula like :
if companyname = 'xyz' then
'Header name'
else
' '
and drag the formula in page header!
or
right click on Page header section,select Section Expert,select Common Tab,
click formula button on right of suppress button ,and write
companyname <> 'xyx'
gazala at 2007-11-9 14:11:58 >

# 2 Re: Conditional Page Header
how exactly do i do this in Crystal? I will have to do the same for the footer too.
thanks
cg
# 3 Re: Conditional Page Header
you mean writing the formula ?
I think you should go for 2nd option for both header and footer i.e suppress the section based on your condition.
gazala at 2007-11-9 14:13:58 >

# 4 Re: Conditional Page Header
i tried the conditional supressing the header and it is not working.
i have tried with and with out checking the supress box with the formula in there.
this is what i have in the formula, the first 2 are the same. i was testing if it was case sensitive or not. this is a parameter field instead of a db field.
{?CustomerName} <> "Typenex Medical, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL L.L.C."
or
{?CustomerName} <> "TYPENEX"
or
{?CustomerName} <> "TYPENEX LLC"
not sure if this makes a difference but i have version 8.5
thanks
cg
# 5 Re: Conditional Page Header
i tried the conditional supressing the header and it is not working.
i have tried with and with out checking the supress box with the formula in there.
this is what i have in the formula, the first 2 are the same. i was testing if it was case sensitive or not. this is a parameter field instead of a db field.
{?CustomerName} <> "Typenex Medical, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL, LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL LLC"
or
{?CustomerName} <> "TYPENEX MEDICAL L.L.C."
or
{?CustomerName} <> "TYPENEX"
or
{?CustomerName} <> "TYPENEX LLC"
not sure if this makes a difference but i have version 8.5
thanks
cg
You have written the expression wrong.
Whatever you have written will be always true in any condition. Just check it properly. Use
NOT (condition1 AND condition2 AND so on)
# 6 Re: Conditional Page Header
Make it simple :
- Right click on Formula field in field explorer
- click New
-name your formula
Type this
if {?CustomerName} <> 'ABC' and {?CustomerName} <> 'XYZ' then
' '
else
'HEADER'
Drag the formula field in report where you want to print the header.
gazala at 2007-11-9 14:17:02 >
