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

Multiple Page Reports - Pdf Pages Together For Each Record

Featured Replies

I have a report that has four separate pages. I am trying to create a script that will either view or PDF all pages together for a subset in my database.

The key field in the database is Symbol. There is a found set of records (called Current Holdings) for which this four-page report needs to be generated, so that each of the four pages are together in a single PDF. In other words, if the first record in the found set is ABC, then I want a PDF file for ABC that contains all four pages of the report. I want to do the same thing for the next record of the same found set. There are a total of 30 records in the current found set...the number of records changes regularly, but the found set is generated using a script called Generate Current Holdings.

I have tried using a loop and haven't been able to isolate a single record from the found set. Every time it comes up, all 30 records for each page of the report are generated. I have attached a PDF of my script, which is setup to just view the pages. I figure if I can view, I can create a PDF later. Obviously, I know it doesn't work, but maybe someone can look at it to see what I'm trying to accomplish. Ultimately, I want one script to view the reports and one to create the PDFs. The four-page reports can even be appended into one single PDF file...I just need to have the four pages together for each symbol of the found set.

Hopefully, I'm not too confusing in my explanation. I apologize if I have left something out or even said too much.

Thank you to anyone who thinks they can help with this.

View_CHSS_Reports_w-Ordered_Pages_Script.pdf

Edited by Guest

You can use the option to append to the current PDF. Here's a sample.

fwiw, if your four-page reports are generated within the same table, you might as well create a four-page layout and create a pdf from that...

AppendToPDF.fp7.zip

Edited by Guest
added fwiw remarks

It would be a lot easier if you had one layout of four pages, instead of four layout of one page each. As it is, you don't have too many options, other than something along the lines of:

# AFTER FINDING THE RECORDS TO EXPORT

#

Go to Record/Request/Page [ First ]

Loop

Set Variable [ $filePath; Value:Case ( Abs ( Get ( SystemPlatform ) ) = 1 ; "filemac:" ; "filewin:" ) & Get ( DesktopPath ) & "ExportFolder/Report" & Table::SerialID & ".pdf" ]

#

Go to Layout [ “Print 1” ]

Save Records as PDF [ File Name: “$filePath”; Current record ] [ Restore; No dialog ]

#

Go to Layout [ “Print 2” ]

Save Records as PDF [ File Name: “$filePath”; Current record ] [ Restore; Append; No dialog ]

#

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

#

Go to Layout [ original layout ]

This exports multiple PDFs to a folder named "ExportFolder" on your desktop (the folder must be created beforehand). Each exported file is named "Report#" - where # is the record's SerialID.

Note the options 'Current Record' in both Save Records as PDF[] steps, and the option 'Append' in the second one.

You cannot simulate this very well in Preview mode. The most you can do is make sure your print setup is set to print current record only.

Sorry, didn't see your post. I'll leave mine anyway, on account of some nuances.

  • Author

Thanks...I was going at this the hard way. That just comes from inexperience, I guess. I did what you suggested and created a single layout with the four pages. Talk about not seeing the forest for the trees!

Appreciate your response. :thankyou:

  • 1 month later...

I have 4,000 records with Region, country and City fields. Have a template with City in the body and have the Region and Country fields as sub-summary.

How can I loop so that it finds all records for Country A, saves it to PDF then loops to Country B, etc.

I need to get a separate PDF for each Region. What would the look look like?

Read up on Summary reports. In your case, you'd summarise by the Country field.

I have done that, but how can I loop a script to print a PDF for every Region?

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.