Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7056 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I wish to put in the header of my form a "Page x of y Pages" counter. In FM5, I had to write a script to go to preview mode, count the pages and insert that number into the "y" page number. I thought I heard that this was simplified in FM7. Has it and how is it done?

Posted

You can do "Page 1 of 4" quite easily.

Step 1: Create a global number field (g_total_pages).

Step 2: Insert the following into your script before displaying the form

Freeze Window

Enter Preview Mode (NO Pause)

Go to Record/Request (last)

Set Field (g_total_pages, Get(PageNumber))

Go to Record/Request (first)

Enter Preview Mode (Pause)

Step 3: On your layout, enter the following:

Page ## of <<g_total_pages>>

Posted

That is what I have been doing in FMP5. I was hoping that 7 had a non scripting way to do this...Oh well. Thanks for the reply.

  • 3 weeks later...
Posted

i have a way to do it with caculation fields

first you do an insert page numer in your header nad you get hte "#" symbol when you are in preiview mode it will show what page you are on that is your" Page ____ "

for the total number of pages the "of ___" part you have to create a feild that is a summary field, it hsould be called something like "total count" and set it to a summary field and select count, and then choose a field that has something in it on every record, then enter this calculation in to a new caculation field

=IN((sum(total count, total count)-1)/x)+1

x should be the number of records that fit on a page

and that should do it

if it doesn't make sense email me at [email protected]

Posted

Another way to do it is to define an unstored calculation field in each table with this calculation: Get ( RecordNumber ) & " of " & Get ( FoundCount)

Then just insert this field into your layout.

Posted

Both of these techiques assume that a constant and integral number of records filt on each page.

I my experience this is rarely so, and the only reliable method is to preview the pages, change to the last page and store the last page number into a global field.

This topic is 7056 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.