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

step by step explanation on how to suppress an element or a section? 1

Status
Not open for further replies.

SamSharma

Programmer
Dec 29, 2004
20
CA
Using CR 8.5, I want to suppress one of the group headers until the details section gets displayed.

I created formulas

// {@true} as
whileprintingrecords;
booleanvar flag := true;

// {@false} as
whileprintingrecords;
booleanvar flag := false;

I drag the false onto a different header, and in the header I want to hide I put into the
Change Format --> Suppress X + 2 (am I suppsed to click the suppress checkbox itself? I tried with and without.)

the formula

WhilePrintingRecords;
// BooleanVar HideMe ;
BooleanVar flag := true;
// HideMe AND flag

so far so good, now the header I want disappeared is indeed gone.

Now I drag the true formula onto the details region. Delete the copy that pops up in the PH section.

The header I wanted does not come back at any level.

So now I've tried various combinations of putting true and false formulas in various locations, & nothing seems to work. The header either is off or on, always.
 
Sam, when you use the formula in the suppression section, you are testing the value of the flag, not setting it, so your formula should use an "=", NOT ":=".

As far as checking the box before using the formula, the conditional formula always overrides the checkbox--BUT, if the conditional formula doesn't execute, the default will be the status of the box. For example, if the value being tested is null, the formula won't execute, and the status of the box then applies.

-LB
 
Thanks (again) for another answer. I'd like to get a general understanding as well, so I can figure it out myself next time (and for anyone else who finds this thread)

What I understand so far

In my 'suppress this component' formula, if the final expression evaluates to true the component will be suppressed. I was trying to suppress GH2. I needed to put

// {@true} as
whileprintingrecords;
booleanvar flag := true;

somewhere so that this would be evaluated BEFORE GH2's expressions are evaluated, then, for GH2, in
GH2 right click-> format field -> suppress (x+2 button)
I put

whileprintingrecords;
booleanvar hide_gh2;
hide_gh2 = true

So now the 'suppress ' evaluates to true & GH2's suppressed.

To now make GH2 to show up in the right situation I need to find a place such that I can turn the variable false. (false suppression means show).

And I need to set the variable false BEFORE GH2's expressions are evaluated.

I think this is one thing that was confusing me to no end. I needed GH2 to show up when the details section showed up. But formulas in the detail section are evaluated after formulas in the GH2. So if I set the variable false in details it does me no good.

And about the error in the original post
I just got TOO frustrated at one point & copied & pasted without double-checking/proofig. As you can see I was in the middle of trying to AND & OR variables when my frustration tolerance broke down.
 
Not sure this is the right approach. Can you explain your report structure and why you would have group headers appearing with no detail section--are there really no detail records in some groups, but with headers still appearing? Or do you have large headers which are set to repeat on each page and you only want them to repeat on the pages where details are displayed?

-LB
 

It's just the way things worked out with the client.

They wanted modified group 1 headers with group 2 footers,
("can I get this heading, but change the words, with this set of numbers, ....")

and modified group2 headers with the details, ...
 
That doesn't really answer my question about your report structure.

-LB
 
on this one particular report there are 2 groups. they did not want to see group headers at all on the top page, but sokme explanatory text.

So I just set some headers to hide.

(I've forgotten at the moment which action caused the headers to turn off for details).

A side effect of this was that no headers were appearing with the details and they wanted GH2 headers on the with the details.

So I needed some way to guarantee GH2 would show up with the details.

I guess another approach may have been to fine-tune which headers I hid?

But there seems to be no programmatic way to hide/unhide, only suppress/unsuppress.
 
Sam,

You still haven't really explained your report layout enough for me to help. If you are only trying to eliminate the group headers on the first page, then use a conditional suppression formula for the group header of:

pagenumber = 1

Hiding is only necessary if you wish to drill down on a header--otherwise, suppression and hiding accomplish the same thing, I think.

If you explained how you have different sections formatted, and how you want the report to display, there might be other solutions.

-LB
 
I just realized (one more of) my problem. In case you didn't realize I'm almost a total newbie to CR.

I've only been using the charts until a couple of days ago, not really looking at the actual tabular reports.

turns out I've had a misconception about what appears at the final drill down level by default.
 
on this one particular report there are 2 groups. they did not want to see group headers at all on the top page, but sokme explanatory text.[\quote]

To handle this situation, place the explanatory text in the Report Header and from the report design tab. click on Format section->new page after.

Now how do you want to handle the reset of the report. As snapsevampire and lbass stated, we need to see your report structure sections.

Page Header
Group header 1
Group header 2
details
Group footer 2
Group Footer 1
Report Footer
Page Footer
 
Yes, I just confirmed it.

the 'show all headers on drill down'

option does a lot of what I just did manually (suppressing headers at some points, forching them to show at other points).

; (

At least I learned how that works.
 
Sam, this is the first I realized you were talking about headers during drilldown!

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top