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

Page header supression in Report Footer Section 1

Status
Not open for further replies.

Snakeroot

Technical User
Oct 4, 2006
112
US
I've been dreading asking for help on this one because this report is so lengthy and a lot of it has nothing to do with my question. I'm going to try to give you enough info to answer my question without making you wade through everything.

For the sake of this question, I have 3 page headers:

Header C which we'll call "TS"
Header D which we'll call "JS"
Header E which is blank

I am reporting with data from SQL. I essentially have 3 Headers that are shown based on the value of the template field of my data. There are 4 possible templates that are acceptable for my report to display.

If the template field value is "TS" or "TS_CM" then the "TS" header (Header C) should be displayed at the top of the page.

If the template value is "JS" or "JS_CM" then the "JS" header (Header D) should be displayed.

Lastly, I have 3-4 static pages that are in the report footer.

I got some help a while back with creating the supression statements for the page headers, but somewhere along the line, this formula stopped working for me.

This is what I have configured at the moment:

Code:
//A formula called pageHeader which contains: 

whileprintingrecords;
numbervar pageHeader;

if (
        {Command.TemplateRef_FullName} = 'TS_CM' OR
        {Command.TemplateRef_FullName} = 'TS'
        ) 
    AND
       ( {@nextrecordnull} = TRUE )
    then pageHeader :=1
    else

if (    {Command.TemplateRef_FullName} = 'JS_CM' OR
        {Command.TemplateRef_FullName} = 'JS' 
        )
    then pageHeader :=0;

// Here I've tried multiple formulas to signify that there are no more records, nullisnext, etc. and I can't figure out a formula to put here, but whatever the formula is, it should make pageHeader :=2;

This is in my Page Header A (which is supressed) and in my Report Footer A.

I have a supression statement in Header C "TS":

Code:
{@pageHeader} = 0 
 OR 
{@pageHeader} = 2


I have a supression statement in Header D "JS":

Code:
{@pageHeader} = 1 or {@pageHeader} = 2 or onlastrecord = true;

On my report, all the JS page(s) display first, then there's a pagebreak, then if any exist, the TS page(s) show.

I've been trying different things all day and so far I can get the JS and TS sections to display correctly, but then my report footer section shows the TS page header...

OR

I can get the JS section to work right, but the TS and Report Footer sections have NO header (which is what should happen in the Report Footer, but not the JS section).

Basically, I can't figure out a way to supress the JS and TS headers once there are no more records and I've reached the Report Footer section.

Does anyone have any suggestions? Thanks
 
You should be able to use formulas like this, as long as you have a page break before the report footer:

PH_c:
(
onlastrecord or
left({template.fieldval},2) <> "TS"
)

PH_d:

(
onlastrecord or
left({template.fieldval},2) <> "JS"
)

-LB
 
The problem with "onlastrecord" is that this condition is true on the last page of the "TS" section and this is also true on every page in the report footer section. It also appears that the template name value is set from the last record in the "TS" section.

Any other suggestions to try?
 
Don't you want the page header suppressed in the report footer section? It would only affect the last page of the TS section if there were only one record. Can that be the case? You could use "Keep group together" in the group expert to avoid that. There is another method you can use, but plese clarify on the first point.

-LB
 
Yes, I want the page header suppressed ONLY in the report footer section.

The previous suggestion supresses on the last page of the TS AND the report footer section.

So in the whole scheme of things, I want the TS header supressed when displaying JS data, then I want the JS header supressed when showing TS data. Finally, I want ALL (or just TS and JS, which would have the same effect) page headers supressed when displaying the report footer.

Also, just for further clarification, the following results "could" happen:

1) JS only
2) TS only
3) JS and TS

(In all scenarios, the minimium number of rows of any type TS or JS that could be returned is 1.)

And since I haven't mentioned it yet, I'm using CRXI R2.

Can you explain further the Keep Group Together idea? My attempts at this didn't seem to make a difference.

One other thing I want to clarify... my page break between the TS section and the Report Footer section happens in the Report Footer and is a "New Page Before", in case that matters.
 
Okay, then take a different approach. Create two formulas:

//{@false} to be placed in the report header:

whileprintingrecords;
booleanvar flag := false;

//{@true} to be placed in the report footer:

whileprintingrecords;
booleanvar flag := true;

Then in the section expert format pageheader_c to suppress with this formula:

whileprintingrecords;
booleanvar flag;
flag = true or //note no colon
left({Command.TemplateRef_FullName},2) = "JS"

Suppress PH_d with this formula:
whileprintingrecords;
booleanvar flag;
flag = true or //note no colon
left({Command.TemplateRef_FullName},2) = "TS"

-LB
 
Thanks for working with me on this LB.

I followed your last instructions and I get the correct header, but then I also get a header in the report footer.

You didn't say if I'm supposed to place the @true and @false variables anywhere, so I experimented with that too. I placed @true in the details and @false in the report footer. It works when there's only one type of template reported on; ie., if there were only records for JS, then I get a JS header and no header in the report footer (this is correct). However, if I use data where there is a JS section and a TS section, then the JS section has a JS header (correct), and the TS has no header (should have a TS header), and the report footer has no header (correct).

It's like the TS section and the report footer aren't being distiguished as seperate sections.

Any other ideas to try?
 
Yes, I did. {@false} only goes in the report header, and {@true} only goes in the report footer. I did test this, and it worked.

-LB
 
Oops, you're right, I missed that.

I placed {@false} only in the report header and {@true} only in the report footer, and with the data I'm currently testing, which only has TS data, I'm getting a correct header for the (1 page) of TS data, then the page break, and then a TS header over the report footer page. Sigh...


Just for kicks, I tried it on some data that has both TS and JS. It also works properly with a JS header over JS data and TS header over TS header... however, there's also a TS header over the Report Footer pages.

Again, it's like there's no distinction between the TS section and the Report Footer section. I'm wondering if I have a checkbox checked somewhere that I shouldn't.


 
Please recount exactly what you did, because it works here--whether there is one or the other or both. Also, you also might try trimming the field wherever the left function is used, in case there can be spaces before the leading character, as in:

left(trim({Command.TemplateRef_FullName}),2)

I'm assuming the field cannot be null.

-LB
 
Sorry it took me so long to get back... I got pulled away on another project.

I went ahead and made a "dummy" report using your suggested formulas and you're right it does work. Like I said in my original post, this report I'm working on has a lot of extra stuff I've left out because most of it would be irrelavent to this problem. I'll have to go digging around to see what is conflicting with this solution.

Thank you for lending me your brain... I should be able to get this worked out now that I have a working model to look at.

Again, you are much appreciated!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top