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

Formula for supressing Page Header 3

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
Would someone be kind enough to show me an example of how to supress a page header if a condition is not met.

I would like for it not to print if nothing is on the page except for what I have in the Report Footer.

The Report Footer is kind of large and at times it prints on the 2nd page because of it's size. There is nothing on the 2nd page except the Report Footer and the Page Header. If the only thing on the 2nd page is the information in the Report Footer, I don't want to print the Page Header because it messes up the look of the report.



Rob
Just my $.02.
 
If your report will only be 2 pages at the most you could put this in the section expert, suppress X-2 --> (pagenumber=2)

Not sure how to do it if it could be numerous pages...

Dustin
 
I'd create a formula prior to the report footer to store the page number, and then in the page header, use a suppress formula based on whether the page number is the same as what it was set to.

Prior to the page footer:
whileprintingrecords;
numbervar CurrentPage := pagenumber;

Page Header suppression formula:
whileprintingrecords;
numbervar CurrentPage;
Currentpage <> pagenumber

If you have other areas in the report that occasionally print and exceed the same page, then reset the page number there as well:

whileprintingrecords;
numbervar CurrentPage := pagenumber;

-k
 
Thanks to you both for taking the time to answer my post. I really appreciate it. I'm kinda just diving into Crystal Reports. I have Version 8.0.

The report is kind of like an Invoice. I don't know how many pages it will be until the order is placed. It's possible that it could be 1 page or 10.

It just looks bad with the Page Header(Qty, Item, Price, ExtPrice,& etc) showing up on the page where only the Report Footer is needed.

I'm not used to Crystal Syntax either. I mostly use VB Syntax. I guess I need a way to get the Number of Pages before the report prints?? Like:

Select Case NumberOfPages
Case NumberOfPages = 2
'Supress page header on page 2
Case NumberOfPages = 3
'Supress page header on page 3
Case NumberOfPages = 4
'Supress page header on page 4
Case NumberOfPages = 5
etc.
End Select.

Would something like this be possible?


Rob
Just my $.02.
 
I think you should just be able to add in format section->page header->suppress->E-2 button:

OnLastRecord

This suppresses the page header after the last detail record.

-LB
 
lbass, Wouldn't OnLastRecord suppress the Page Header on the page the last record was on?

Reebo
Scotland (Sunny with a Smile)
 
No, actually it doesn't. It has always worked for me--I think it must actually set the report so that the next instance of the page header does not print, which means the next page after the last detail.

-LB
 
Thanks LBass. That's the simple example that I was hoping for.

Rob
Just my $.02.
 
Reebo: You're right, if the last page of the report only contains the last record, then it will suppress it, which is why I wouldn't use that method.

-k
 
I just tested this by forcing only one detail on a page at the end of the details section, and SynapseVampire is right, the page header does disappear. I guess I just virtually never have only one detail on a page, so this hasn't arisen for me. You could use my method judiciously--checking to make sure you don't have a &quot;dangling detail&quot; and if you do, infinitesimally resizing the detail section until you have at least two details, and voila, the page header reappears--but ideally you want a method that works all the time, so you should consider using Synapsevampire's method!

-LB
 
Thanks. I gave him a star too, though I really don't understand where to put his method to work. I'm a newbie at this Crystal stuff. Is that code put in while using the designer, or at runtime in asp code?

Rob
Just my $.02.
 
Of course, if you are sure it will never go further than 1 extra page, you could always put:

pagenumber = totalpagecount

in the suppress formula. This will suppress the Page Header on the Last page ONLY.



Reebo
Scotland (Sunny with a Smile)
 
Thanks a Million to all. I appreciate the help.

Rob
Just my $.02.
 
Well like the person in the topic &quot;Supress Pg Header After Last Record Read?&quot; I spoke too soon too.

I understand that I need to put the information that Vampire has given me in the report at design time, I just don't know how or where to do it. I'm sure it's in the &quot;format section&quot; but I'm confused.

I only have, and in order they appear on the DesignTime bar:
Report Header
Page Header
Details
Report Footer
Page Footer

Like:
Prior to the page footer:
whileprintingrecords;
numbervar CurrentPage := pagenumber;

Where do I put it. Right click on the designtime bar, format section then what section. The details section is right before the page footer.

Page Header suppression formula:
whileprintingrecords;
numbervar CurrentPage;
Currentpage <> pagenumber

This part I think my &quot;shallow old&quot; mind comprehends. Right Click on the Page Header in the DesignTime bar. Is it the &quot;Suppress(No Drill Down)&quot; Section, or the &quot;Suppress Blank Section&quot;.

If you have other areas in the report that occasionally print and exceed the same page, then reset the page number there as well:


I'm at a total loss to this. The details section on the report may be one line or 3+pages at times.

whileprintingrecords;
numbervar CurrentPage := pagenumber;

Where would this go.

TIA



Rob
Just my $.02.
 
Create a formula for:

Prior to the page footer:
whileprintingrecords;
numbervar CurrentPage := pagenumber;

You can right click any section and select insert section to create multiple sections, in this case you might want to place the formula in the first page footer section.

-k
 
Thanks Vampire. I caught that, but I'm don't understand how or exactly where it should be placed in the page header. I guess I'm asking, &quot;how do I get there to do it&quot;?

I know I can right click on the header in the desiginer, but where do I go from there?

Rob
Just my $.02.
 
Right click the Page Header->Format Section->X 2 next to suppress:

Page Header suppression formula:
whileprintingrecords;
numbervar CurrentPage;
Currentpage <> pagenumber

-k
 
Thanks Vampire. I won't be back in the office until Monday, but I'll give it a shot.

I take it that the &quot;Page Header suppression formula:&quot; goes in the x-2 button formula to, or leave that off?

Rob
Just my $.02.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top