5 Replies Latest reply on Sep 15, 2014 4:41 PM by philmodjunk

    Page numbers issue



      Page numbers issue


      I am having filemaker create a report that needs to be in three different layouts then pdfs.  These will then later be put together into one pdf/report.  It is a long story why they need to be 3 different layouts then pdfs.

      Description of layouts

      • Layout 1 will vary in number of pages (anywhere from 2-8 pages)
      • Layout 2 will always be 3 pages
      • Layout 3 will vary in number of pages (anywhere from 2-10 pages)


      I can easily put page numbers on layout 1 but the problem starts with layout 2.  How can I teach the computer to look and see how many pages where in layout 1, then make the first page of layout number 2  Page (Layout 1 pages + 1)?  Then make the first page of layout 3 be (total number of pages in layout 1 + 4.

      Is that possible?

        • 1. Re: Page numbers issue

          This is a really good question. Are you generating the PDF files (save as PDF) from within FileMaker? Are you using the "append" option? I need to think on this one.



          • 2. Re: Page numbers issue

            Ideally I want to run a script that just creates three pdf files and "appends" them all into one file without anyone knowing.

            Second best solution would be to just have the script generate three pdf files and I can merge them together manually later.


            • 3. Re: Page numbers issue

              It's possible to set up an unstored calculation field such as:

              gPageOffset + Get ( PageNumber )


              $$PageOffset + Get ( PageNumber )

              You then use a script that:

              Enters preview mode
              Goes to the last page and then sets the global variable or field to Get ( PageNumber )

              Depending on whether you set a field or a variable you may need to drop out of preview mode, set the value and return so a variable sounds like a simpler option.

              You would, of course, put the calculation field on your layout to show the page number.

              • 4. Re: Page numbers issue

                Thanks for the response Phil.  Sorry to be a pain here but can you (or someone else) explain your answer a little more.  Although that was a clear explanation, I'm still getting a little lost (ok, a lot lost).    I know how to use calculation fields and I know how to run scripts.  I think it is the specifics of the scripts and using a variable that is getting me lost

                Me not understanding this makes me think of this scene from back when The Office was funny.  http://vimeo.com/27060669



                • 5. Re: Page numbers issue

                  I'll answer in terms of the first two layouts and leave it to you to extend this to three.

                  Define your unstored calculation field, cPageNumber like this: $$PageOffset + Get ( PageNumber ). Define it in the table that's the basis for layout #2.

                  Put that field on your second layout where you want to show the page number

                  Now use this script to set $$PageOffset to the correct number:

                  #On Layout #1. perform a find, sort records or whatever you need to set up the first part of your PDF
                  Enter Preview Mode [] --> clear the pause check box
                  Go to Record/Request/Page [Last]
                  Set Variable [$$PageOffset ; value: Get ( PageNumber ) // get the page number of the last page from layout #1's part of the report ]
                  Save As PDF ---> generate the new PDF with the first pages of your report
                  Go to Layout [Layout #2]
                  #Do whatever you need to produce the needed found set for the second part of your report.
                  Save As PDF, but with the append option to append it to the PDF produced from Layout #1.

                  Caulkins Consulting, Home of Adventures In FileMaking