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

Manual page number with reset

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
US
Crystal 8.5
SQL Server 2000

To reset each page number for each patient in the report. Report is duplex printing, printing one page on front, next one on back - remainder(pagenumber/2)=0

Report has main report with 5 groups, in 4th group is subreport.
G1 - Unit
G2- Unique ID
G3- Patient Name
G4 - Patient UI
G5 - CodeNum

Section Expert - New page before subreport prints. The first page of the report is informational. On the main report the information page resides in GH4a,b,d,e and details.

For example:
PAGE 1
Bill Smith Acct:987 01/02/1970
Allergies: Bees
Provider: Dr. Hyde

New page after PAGE 1

PAGE 2 (subreport)
Bill Smith
Medications: (CODE)
Epi Pen
1 dose when stung

New page after each CODE section

Page 3 Page 4 Page 5
Bill Smith Bill SMith Bill Smith
Nutrition: Physical: Laboratory:
Honey Toast Exercise CBC
for snack

The resulting report would be 3 pages. The first page and second page on 1 sheet of paper and the 5th page with Lab on the front and a blank page on the back. The page count should be 1 of 3. What I end up with is 1 of 2, with the page count for the next patient starting on the back of page 5.

I have created a variable that sets the page count and resets it:
Code:
@patientpagenum
whileprintingrecords;
numbervar PTpagenum:= PTpagenum +1;
@Resetpatpagenum
whileprintingrecords;
numbervar PTpagenum:= 0

But can't get it to work. It either stays at zero when in the page header or doesn't count correctly when in the Group sections.

Any ideas?
 
First you need to make sure the report is returning a blank last page for the group. To do this, insert a second group footer section for the patient group and format thie GF_b to new page before and new page after and add a formula to the section suppression area:

remainder(pagenumber,2) <> 0

Next create two formulas:

//{@reset} to be placed in the patient GF_b section:
whileprintingrecords;
numbervar pageno := 0;

//{@pageno} to be placed in the pageheader:
whileprintingrecords;
numbervar pageno;

if remainder(pagenumber,2) <> 0 then
pageno := pageno + 1 else
pageno := pageno;

This will number the front and back of each page within each patient group with the same number: 1,1,2,2,3,3.

If you don't want the pagenumber to appear on the back, then you can conditionally suppress it with:

remainder(pagenumber,2) = 0

-LB
 
I got the duplex printing programmed. Then created the two formulas you provided.

When I put them in GFb and PH, this is my results:
Page # Formula result
1 1
2 1
3 2
4 1
5 2
6 1
7 2
8 1

I moved it around to different sections and it gave me 0,1,2.

 
I think you must have the reset in the wrong place, but I can't tell, because I don't understand your report structure as it relates to your defined groups. Are the three pages based on Group 3?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top