Jump to content
Server Maintenance This Week. ×

Print multiple records with correct page numbers on footer.


SteveS

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

Recommended Posts

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.

Link to comment
Share on other sites

... 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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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. ;-)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 4620 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.