You are here:

Filemaker/Scripting in Filemaker 12

Advertisement


Question
I am trying to set page numbering as Page 1 of 2, Page 2 of 2 or page 2 of 3 and so on,
I have tried using the example of inserting Merge Variables in Filemaker help, but I don't have enough knowledge of how it all works to understand why I can't complete which seem to me a simple task.

Any help you can give would be great.

Joe

Answer
i apologize for the delay, my email, website, domain name, etc all went down and it has taken a while to get back up.
I am sorry you are having difficulty with this page numbering thing. I too struggled with it. Good news though:
Your question is a common one with a simple solution.

Here are the steps to follow (two ways, with a script and a global or with a script and a script variable.

Good luck!

Let me know if you still need help with anything.

To display the total number of pages on each page of a printed document using a script, follow these steps:

In Manage Database, define a number field titled Page Count. Click Options (or double-click the field name). Click the Storage tab, then select Use global storage (one value for all records).
On your print layout, type "Page ## of <<Page Count>>" (without the quotes) in the header or footer.
(## prints the current page number, <<Page Count>> is a merge field).
Create a script that has these steps:

Go to Layout [The layout you want to print]
Enter Preview Mode [ ]
Go to Record / Request / Page [Last]
Set Field [Table::Page Count, Get ( PageNumber )]
Go to Record / Request / Page [First]
Pause/Resume Script [Indefinitely]
Print [ ]
Enter Browse Mode [ ]
Set Field [Table::Page Count, ""]
Go to Layout [original layout]
If you are using FileMaker Pro 11, you can do this without a global field - you can use a script variable with a merge variable on the layout. Follow these steps:

On your print layout, type "Page ## of <<$pagecount>>" (without the quotes) in the header or footer.
(## prints the current page number, <<$pagecount>> is a merge variable).
Create a script that has these steps:

Go to Layout [The layout you want to print]
Enter Preview Mode [ ]
Go to Record / Request / Page [Last]
Set Variable [$pagecount; Value:Get ( PageNumber )]
Go to Record / Request / Page [First]
Pause/Resume Script [Indefinitely]
Print [ ]
Enter Browse Mode [ ]
Go to Layout [original layout]

Filemaker

All Answers


Answers by Expert:


Ask Experts

Volunteer


Jeffrey Cannon

Expertise

I have over 20 years experience in FileMaker Pro and desktop computers (I work with PCs but I am really a Mac guy). I am expert in the FileMaker Pro GUI, scripts, creating new custom databases, migrating data from Excel/Word/other databases to FileMaker. I am an expert in tips and tricks and solving problems. I am pretty good at the Instant Web Publishing stuff too.

Experience

20+ years of FileMaker development and Mac/PC troubleshooting, networking, training, purchasing etc.

Organizations
FileMaker TechNet. FMPUG. Frequent speaker at the Apple Store on Michigan Ave in Chicago.

Education/Credentials
BA. University of Washington

©2016 About.com. All rights reserved.