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

Page Number not reset to 1 1

Status
Not open for further replies.

Wes1961

Technical User
Aug 21, 2001
72
US
I have a Data Grouping assigned in a report format.

I then checked the box "New Page" and "Reset Page Number".
When I print the report, the first report starts with page "1", it the breaks at the proper place based on the grouping, ejects to a new page and starts page numbering with "2" instead of "1".

Any ideas how to correcct this?

I'm using FoxPro 2.5 for DOS.

Thanks in advance!
 
Are you only using the system variable _pageno as the expression for your printed page number?

Rick
 
Also, Do you have the Page number in the Group Header/footer area?? David W. Grewe
Dave@internationalbid.com
 
I am using the system variable _pageno to print the page number and it is in the header section.
 
Not to get real picky, but the header section you are referring to is the area labeled "PgHead"? And while you say FPD 2.5, are you running the last version 2.5b? (?Vers(1) shows FoxPro 2.5b (x) [Sep 28 1993 11:47:04] Serial # 00-xxx-xxxx-xxxxxxxx )

Are you calling any UDFs that might change the record pointer in the underlying table?

Rick

 
The header section I am refering to is the "PgHead" section. I have the following on the first line to the right side of the report : Page: _pageno

The first report (or grouping) prints fine, starting with one and incrementing by one to the last page. Next grouping (and each one thereafter) ejects to the next page and starts the page numbering with "2", then increments by one to the end of that grouping. When looking at the printed report it makes it appear that "Page 1" is missing.

I am running the FoxPro 2.5a (X) [Jun 25 1993 00:16:32] version. Can I download the upgrade?

Not sure if I am calling any UDF's but I don't think I am. Novice programmer using FoxPro.

And feel free to get picky, no one can complain about free help/advice.

Thanks again.
 
Move the Page Numbering from The Page Head Band to the Group Head Band. David W. Grewe
Dave@internationalbid.com
 
Moved page numbering to the group header.

Same result page numbers start at "2" for the second report and all folowing reports.
 
MS removed those patches from availability a long time ago (~3 years?) However there are places out on the web that seem to have them - e.g. is one. No guarantees.

I ran a couple tests on my 2.5b, and can't seem to get your results, so maybe the "problem" was fixed in 2.5b.

Sorry about the reference to User Defined Functions (UDFs). When you need to get real tricky in the report writer, you can use these to do some amazing things. (e.g. Alternate table lookups, process the same record multiple times, skip records without using a FOR clause on the REPORT command, alter the "Printing..." Window, etc.) If you want to see some real Tricks, go to choose the Presentations area and download the Slides and Source Code and see what Cathy has done. While many of these "Tips & Tricks for the FoxPro Report Writer" are specifically for Visual FoxPro, many also apply to the older FPs.

Rick
 
Rick,

Know of any other locations to get the "b" version? that link does not appear to be working.

Wes
 
Wes,
Curious, I just clicked on the link shown above and it seems to be alright. Any chance your ISP is blocking access to Russian sites?

You'll only find it on foreign sites, because no one wants to cross MS - who still has a valid copyright on this material. I think I found it on a couple Japanese and German sites also. I just put "FoxPro 2.5b" into IE's search box and then looked through the hundreds of hits on the four search engines you get by default (it showed up on a lot of resumes). The Russian one listed above looked the most organized and had the link captions in English.

Rick
 
Don't know why I could not get there yesterday, however, this AM I downloaded and applied the patches which brought me to --- FoxPro 2.5b (X) [Sep 28 1993 11:47:04] ...

Problem still persists ... beginning to tick me off because this is such as no brainer (or should be) issue.

I have tried this on other computer but get the same results. Doesn't surprise me since I think they were all copeid from each other and not installed from original disk. Which will be my next move, if anyone can find the disk.
 
Wes,
I'm glad you got updated OK - at least this one variable has been removed.

Have you tried this report with different data? Maybe there is something "unique" about the set you are using. Over the years, I written / maintained hundreds of reports (starting in FP 2.0) with the report designer, and I don't recall running into or hearing of a similar problem.

Are you running the report directly from a data table (any relations set up to other tables), or did you build a temporary table/cursor with all the required data?

What does the data grouping expression look like? Is the data source directly indexed, sorted or ordered on this expression?

Are you using any conditionals on the REPORT statement?

Any additional information to help us help you would be appreciated.

Rick
 
I have found the source of my problem. Although, it makes no sense why this causes a problem, I can turn on the problem and turn it off. In the original report format I had the format name in the page footer. ie... (blkshi1.frx)
This causes the second report to begin with "2". Removing the text from the footer and the printed output is fine. I have tried different text with and with the " () " and the problem persists.

Bottom line is: If the footer is blank, page numbering is OK. Anything in the footer and the second report starts with 2. Go figure.

Thanks again for your help.
 
Congrats on a "solution", when I get the time I'll have to try that variant out.

Off the top of my head, if you still want to print that info in the page footer, consider creating a variable just before doing the REPORT command, then create two UDFs. The first call from the PAGE HEADER to store off the value, and the second to display it in the PAGE FOOTER. e.g.

lcFooter = ""
REPORT FORM blkshi.frx ...
...


*SvPgHead.PRG
PARAMETERS pcINFO
lcFooter = pcINFO
RETURN ""

*DispFoot.PRG
RETURN lcFooter

Then anywhere in the PgHead area define a new print field with a value of SvPgHead(<data you want in footer>) [Note: The function returns a null string, so it won't actually print anything.] Then replace the expression you have in your PgFoot with DispFoot().


Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top