Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Print multiple records with correct page numbers on footer.

Featured Replies

Hello,

I am using Filemaker Advanced 10. I have a script listed below that shows page # of # on the footer of each record in form view. Each record varies in length depending on the amount of text included in each record. This script works fine if you print one record at a time. I want to print multiple records at once and set the correct page number for each record starting with 1 and ending with the correct number of pages per record. The script below shows the footer page 1 of the total of all pages instead of each record.

Freeze Window

Go to Layout [ “K-9 Reports Print” (K-9 Reports) ]

Enter Preview Mode

Go to Record/Request/Page[ Last ]

Set Field [ K-9 Reports::gnumberpages; Get ( PageNumber ) ]

Go to Record/Request/Page

[ First ]

Print [ ]

Enter Browse Mode

Set Field [ K-9 Reports::gnumberpages; "" ]

Go to Layout [ “K-9 Reports” (K-9 Reports) ]

I would appreciate any help you could give me.

You are setting the last page number, rather than the current page number, for every page?

... shows page # of # on the footer of each record in form view. Each record varies in length depending on the amount of text included in each record. This script works fine if you print one record at a time.

Please clarify ... form view?

  • Author

Yes, Form View.

  • Author

Efen,

I changed the last page number to the current page number and this gives me the correct page number, but it does not give me the correct last page number of each report. I thank you for the first obstacle accomplished, but I believe there must be a way to show the last page number (total pages in report).

  • Author

Doughemi,

I tried that before and it did not work.

On your footer insert the current page number symbol and your gnumberofpages field such as:

Page # of <<gnumberofpages>>

The reason I asked if it was form view is because the 'page number' will always be the record number.

"there must be a way to show the last page number (total pages in report)."

You should be using a list layout instead of a form layout. You can set it to new page break before every occurrence of the primary key. List layouts allow fields to reduce if they take less space. But you have given us nothing about how you have the report set up. It would help if you could create an empty clone, zip and attach your file.

As an aside, if you see that your copy/pasted text is smaller than other text here, please increase the font size (the script itself was nearly impossible). Some folks have trouble reading text this small. As you will notice, I wear glasses but not everyone does. ;-)

The reason I asked if it was form view is because the 'page number' will always be the record number.

Not necessarily. If the body part is several pages tall, and objects are set to slide up, then each record can occupy a different number of pages.

This script works fine if you print one record at a time.

That's probably the best way to go about it: print each record in a loop.

  • Author

LaRetta,

The form view report layout extends 10 pages long and the text field enclosed is set to sliding and reduce size of the enclosed part. It seems like this should be a very simple thing to accomplish but after reviewing previous posts, it is not. I am not an expert and was simply looking for advice.

Hi Steve,

If I sounded judgmental, I was not feeling so. It just seemed unusual. Form layouts (at least for me) are designed to fit a monitor screen with no scrolling. I don't think I've ever printed one (except for software documentation) and I had difficulty visualizing what you wanted. :mellow2:

"I ... was simply looking for advice."

Of course, that is (almost) a given when someone starts a new post. And I was only looking to assist. :smile:

In order to produce a report that has a footer page # of # total pages, and you wish the total page count to "restart" for each record, then the report can only include one record.

So, as comment suggested, you need to loop in order to click a button and produce more than one report at once.

pseudo code:

Create a found set

Loop

Perform script "Print Report"

go to next, exit after last

End Loop

Yes the the Report layout should Restart the pagenumbers after each 'Body'

The pageNumbers field is a normal Number field in the table ( no global storage!!)

And the print script would look like:

Go to Layoput [ "RPT Standard Form” ]

Enter Browse Mode

Go to Record/Request/Page [ First ]

Loop

New Window [ Name: "temp"]

Show All Records

Omit Record

Show Omitted Only

Enter Preview Mode

Go to Record/Request/Page [ Last ]

Set Field [ table::pageNumbers; Get ( PageNumber ) ]

Close Window [ Name: "temp"; Current file ]

Go to Record/Request/Page [ Next; Exit after last ]

End Loop

Print [ ]

This way the user will only be presented with the Print settings once.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.