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

displaying group name in Page Header section 1

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
CR8.5
I have a need to display Group name in the Page Header section of my report. The group name should only appear when it changes. So say if GroupName1 has two pages, the second group, say GroupName2 should start on third page.
I tried following in the supress section of the page header section, but it is showing only first group name.

{table1.GROUP1}=Previous({table1.GROUP1})
and not(onfirstrecord)
and not (onlastrecord)
 
If you formatted the group header to "new page before" in the section expert, then you could copy the group header into the page header and it would always appear as you wish.

If you can't format your group header to new page before, please clarify what value should be in the page header if a group continues from a previous page but then ends and another group starts on the same page. It would be easy enough to show the new group on the next page where it continues, but not sure that's what you want.

-LB
 
Looks like I will have to change my logic. I appologise for that. Basically I want to display a static text on first row of each page. Is there an easier way to do that?
 
Not sure what you mean by first row, but you can place a text box containing any text you want in the page header.

You can also format your groups with "Repeat group header on each page" and place information in that section.

-LB
 
Let me xplain in details. Here is the report layout
-----------------------------------
Page 1
Group1
Fname,Lname $45000 X
Fname2,Lname2 $30000
Fname3,Lname3 $2500
Group2
Fname,Lname4 $15000
Fname2,Lname5 $20000
Fname3,Lname7 $21500

---------------------------------------
Page 2
Fname8,Lname8 $18000 X
Fname9,Lname9 $17000
Group3
...... so on

I just need to display an 'X' on first record of each page at the details line. I hope this explains my problem.
 
Create these formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar counter := 0;

//{@X} to be placed in the detail section:
whileprintingrecords;
numbervar counter := counter + 1;
if counter = 1 then "X" else ""

-LB
 
Worked like a charm. Can you explain the logic please? How come counter ramins at 1 when placed in the Details section? Shouldn't it change?
 
The counter doesn't remain at 1. If it did, there would be an X in each detail row. If you changed the formula to:

whileprintingrecords;
numbervar counter := counter + 1;
counter

...you would see it increment. The original formula sets the counter, but the final clause in the formula is what is displayed, and that says to display the "X" only when the counter equals 1.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top