1 2 3 Previous Next 44 Replies Latest reply on May 23, 2012 9:07 AM by PatriciaSamuelsen

    Save Records as PDF

    PatriciaSamuelsen

      Title

      Save Records as PDF

      Post

      Is it possible to save a report as separate pdfs based on a sort field?   

       

      I've sorted and sub-totlaled the records by family (with a page break) and would like to save each famiily's report to a separate pdf and email it to them.  

       

      Thanks.

        • 1. Re: Save Records as PDF
          davidanders

          You do not mention your version of Gilemaker or your OS version

          Google "save as pdf site:filemaker.com"
          https://www.google.com/search?q=save+as+pdf+site%3Afilemaker.com

          LINK #1
          http://www.filemaker.com/12help/html/import_export.17.4.html

          Home > Sharing data > Saving, importing, and exporting data > Saving and sending records in other formats > Saving and sending records as a PDF file

          Saving and sending records as a PDF file

          You can save FileMaker Pro data as a PDF file in all modes except Find mode. The PDF file’s appearance is based on the current layout when you create the PDF file.
          You can assign a password to the PDF file if it contains sensitive information. If you assign a password, the file is encrypted and cannot be opened without the password. FileMaker Pro can also create a blank email message with the PDF file as an attachment to make it easy to distribute to others.
          To save PDF files, your access privileges must allow printing. For more information, see Editing other privileges.
          To append records to an existing FileMaker Pro PDF file, you must create a script that uses the Save Records as PDF script step and select the option Append to existing PDF. For more information, see Save Records As PDF.
          Note  Saving records as a PDF file is not supported in runtime solutions.
          To save records as a PDF file:
          1.
          Display the layout that you want to use as a basis for the PDF file.
          For more information, see Switching between layouts.
          2.
          In Browse or Layout mode, choose File menu > Save/Send Records As > PDF.
          In Preview mode, click Save as PDF in the status toolbar.
          3.
          In the Save Records As PDF dialog box, enter a name for the file, specify where to store the file, what to save, whether to automatically open the file, and whether to create an email with the PDF file as an attachment.
           •
          You can save the current record, all the records in the current found set, or a blank record that can be used as a paper form.
           •
          If you select Blank record, the Appearance option is enabled to define how the fields are formatted in the PDF file.
           •
          If you select Create email with file as attachment, an email is created with the PDF file attached, and you then specify the recipient.
           •
          If you select Automatically open file, the file opens after it is created.
          4.
          Click Options to set the PDF options:
           •
          In the Document tab, enter descriptive information about the file, the version of Acrobat for viewing the file, and page numbering.
           •
          In the Security tab, assign passwords to the PDF file, as well as print and edit privileges. If print and edit privileges are allowed, specify if copying and screen reading software are permitted. For more information, see PDF Options dialog box.
           •
          In the Initial View tab, define how an opened PDF file will look.
          5.
          Click OK.
          6.
          Click Save.
          • 2. Re: Save Records as PDF
            PatriciaSamuelsen

            I'm running Filemaker 12 on Mac OS 10.6.

             

            I did see these pdf instructions, but I want to do something a little different.  I have a single pdf file that includes a confirmation form for each customer.  Is there anyway to email just the appropriate page to each customer.  

             

            I'm wondering if I need to actually run the Script for each customer to produce, pdf, and email the form, and then go to the next record and repeat.  I assume there is a way to automate that in a Script.

             

            Does that sound like a better solution?  

             

            Thanks for your help.  I'm probably way out of my depth here.

             

            Pat

            • 3. Re: Save Records as PDF
              philmodjunk

              You'll need to generate separate PDF files for each customer so your idea to produce, pdf and email should work for this.

              • 5. Re: Save Records as PDF
                philmodjunk

                You may find the info in this thread helpful: Found Sets to PDF with unique file names

                • 6. Re: Save Records as PDF
                  PatriciaSamuelsen

                  You'll need to generate separate PDF files for each customer so your idea to produce, pdf and email should work for this.

                   

                  I've cogitated on this for a while, and I think I've reached the limit of my knowledge.  Can you point me in the right direction for how to accomplish this?

                   

                  I've selected the correct records and sorted them by Family.  There can be various number of records for each family.  For each group of records with the same Family ID, I need to produce a report, pdf it, and email it.  I can figure out the last two steps.  I'm just not sure how to do the first one.

                   

                  I assume I need to Constrain the found set to the first Family ID, but how do I do that in the Script?  Then how to I move to the next Family ID?  How do I know when I'm done?

                   

                  Is this too complicated?


                  Thanks!

                  • 7. Re: Save Records as PDF
                    philmodjunk

                    I'd need to know more about your database to suggest how to pull up the correct found set in order to use save as PDF to make a PDF of it.

                    There are two basic approaches you can use to pull up the needed found set: Go to Related records (if there is a relationship that will serve) or perform find (which can include a constrain found set in some cases.)

                    • 8. Re: Save Records as PDF
                      PatriciaSamuelsen

                      FileMaker Pro 12

                      Mac OS 10.6

                       

                      I actually have two reports that I need to handle this way--one for instructors and one for families.  The instructor scenario is a little simpler:

                      Tables:

                      Instructors (includes pertinent information about each instructor)

                      Classes (includes pertinent information about each class offered)

                      Students (includes pertinent information about each student)

                      Enrollments (includes an Instructor ID, a Class ID, a Student ID from the previous tables, as well as a school year designator)

                       

                      Report:

                      Find all the Enrollment records for the current school year.

                      Sort them by Instructor, Class, Student in order to generate class rosters for each class an Instructor teaches.

                      (I've got this report finished and working. Now for the hard part:)

                      For each Instructor who has enrollments in the current school year, I need to generate this report (which would include only that Instructor's enrollments), pdf it, and email it.  I assume I would need to Constrain the previous Find set to include the enrollments for only the first Instructor, but I'm not sure how to do that, since I wouldn't know which Instructor it is (not all Instructors in the Instructor Table will have enrollments in the current school year.)

                      Then go to the next Instructor who has enrollments in the current school year and repeat.  

                      It's the last two steps that I don't know how to do.

                       

                      Any help would be appreciated.

                       

                      Pat

                      • 9. Re: Save Records as PDF
                        philmodjunk

                        Constrain found set would only work for the first instructor as it will drop records for other instrutors out of the found set and then there will be nothing to drop out for the next instructor. Figure out how to perform a find for just one instructor that pulls up the report you need, then script it.

                        Two general methods you might use:

                        #From  a layout based on instructors where you'd loop through a found set of instructor records...
                        Go to Layout [instructors]
                        #Perform your find for instructors here or do a show all records
                        Go to record/request/page [first]
                        Loop
                           Set variable [$InstructorID ; Instructors::InstructorID]
                           Go to Layout [your report layout]
                           Enter find mode []
                           Set field [Instructors::InstructorID]
                           #use set field to specify any other relavent criteria here
                           Set Error Capture [on]
                           Perform Find []
                           Sort [no dialog ; restore ] // if sorting is needed for your report
                           If [Get ( FoundCount ) // at least one record was found]
                              #put your save as PDF stuff here
                              Go to Layout [Instructors]
                              #Send the email here
                           Else
                              Show Custom Dialog ["Error: no records for instructor# " & $InstructorID ]
                              Go to layout [Instructors]
                              Exit Script[]
                           End If
                           Go to Record/Request/Page [Next ; exit after last ]
                        End Loop

                        • 10. Re: Save Records as PDF
                          PatriciaSamuelsen

                          Thanks so much!  I'm working on this.  Quick question.  Is this actual syntax, or was I supposed to translate it into something?  

                           

                            If [Get ( FoundCount ) // at least one record was found]

                          • 11. Re: Save Records as PDF
                            PatriciaSamuelsen

                            Is there a way I can paste my Script here?  It's not letting me copy and paste.

                            • 12. Re: Save Records as PDF
                              PatriciaSamuelsen

                              I think I am very close.  When the Script executes the Save step, however, I get this error message: 

                              “$InstructorID.pdf” could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

                               

                              I'm just saving it to my hard drive.  Any idea what might be wrong?

                              • 13. Re: Save Records as PDF
                                PatriciaSamuelsen

                                I think I am very close.  When the Script executes the Save step, however, I get this error message: 

                                “$InstructorID.pdf” could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

                                • 14. Re: Save Records as PDF
                                  Sorbsbuster

                                  "Is this actual syntax, or was I supposed to translate it into something?  

                                   If [Get ( FoundCount ) // at least one record was found]"

                                  If [Get ( FoundCount ) will return a 'True' is there is more than 1 record, so it is the correct syntax.  The part after the // is just descriptive text.
                                  You can use that to give feedback to the user than the instructor didn't have any records.  They will have to clikc 'OK' to continue with the next instructor.  If that is useful that is great - f not you can use Set Error Capture [On] and then just skip to the next instructor without informing the user.  Horses for courses.

                                  When you get the message ' “$InstructorID.pdf” could not be created...' I am guessing that you are trying to save a file whose filepath is literally “$InstructorID.pdf”.  That is not what you want - you want the $InstructorID to be a variable component of the calculated file path.  It might look like:

                                  file:/C:/MypdfFiles/1001.pdf

                                  where the 1001 part is the value of the $InstructorID variable at that time.

                                  1 2 3 Previous Next