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!

How do you surpress and Header Section(s) based on a condition? 1

Status
Not open for further replies.

McNab

Programmer
Jul 23, 2001
101
CA
Hey All,

In Crystal Rpts (CR 6.0 is what I'm using) how do you surpress an entire section? Here is what I want to do...if {policy.status} = "Surrendered" then **I want to have {Group Header #9b to Group Header #9g} to be surpressed**

It's a datafile ... so no SQL/ODBC, Access database too!

Any ideas ?

Thx

Jamie in Canada
 
Hi,
I don't know about ver 6, but here is how we can do it in ver 8

Go to Format menu> choose section> there select the required section (one at a time) then click the "Override" button beside the text "supress(no Dril Down) " , write your condition there.

That's all !

-Bye PKG
 
Thx ... but...

What does the condition consist of?

if {policy.status} = "Surrendered" then
?

What is the command to "surpress". " " or "" doesn't seem to work

Thx

Jamie
 
A conditional suppress gives a boolean result, which means that you don't need an if then else or a suppress command for it to work. You just need the following:

{policy.status} = "Surrendered"

 
Jamie

You're almost there - rather than
'if {policy.status} = "Surrendered" then'... just do
{policy.status} = 'Surrendered'
In laymans terms, here is a scenario
I want to suppress the Group Header#1 section whenever the surname in the customers file equals 'Smith'

Do;
right-click the section to be suppressed (on condition met, i.e, Group Header#1) and select 'Format Section'. Select the 'X-2' button along side the 'Suppress (No Drill-Down)' and type as a formula 'customers.surname='Smith'

That's it - whenever a 'match' is made, the section will be suppressed.

To resolve your problem, you would need to go into each relevant section (Group Header 9b - Group Header 9g), do as above but make your formula equal to:
{policy.status} = "Surrendered"

Hope it helps

Richard
 
Thx a lot guys!

This is exactly what I needed!

Thx again!

Jamie in Canada :)
 
Well ...

It didn't work? The group has many subsections, group 9 a to group 9 g. First I tried the condition like you said in the Format Section part, under X2 button, I entered {policy.status} = "Surrendered", in the first group (group 9 a). That didn't work. So I entered that into each of the other groups. It still prints out. There is a lot of fields which are still pulled into each of these header sections. If one condition for them is met, will it print it out regardless of the {policy.status} = "Surrendered" condtion in the Format Section part?

Thx

Jamie
 
The answer to your question is no, if you placed the conditional suppress in Format Section. In other words, if policy.status is ever equal to Surrendered, then the entire section that you placed the conditional will be suppressed.


Are you getting data back that contains a status of "Surrendered"? What data type is policy.status?
 
Interesting...

I doesn't work. I put the condition on all of the fields in each field/formula's ect. and it seems to work...kinda. I have boxes in them that are a diff colour and they still come out. But they come out all over the place. Like in between detail parts and at the end of the rpt. I'll keep playing with it. Thx for the advice, but I don't think you are correct (no offense!). I'll keep playing/fighting with it and I'll post the results.

thx again!

Jamie
 
Looks like I can't do it (oh .. by the way .. i'm using Crystal Reports 6.0 .. which is crap...no looping logic, just big "if" stmts) You cannot put a condition on a box, you can only check off surpressed but no "X2" button. I think it's a "no go". Thx for the help anyway, I really apprecitated it!

Thx again,

Jamie in Canada
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top