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

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

Recommended Posts

Posted (edited)

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
Posted (edited)

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
Posted

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.

Posted

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

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?

Posted

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

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