The Original FileMaker Community
Business Templates - Demo Apps - Video Tutorials -Samples - Help - 46000 Member Forum

The Leading Filemaker Developer Tools

Handling PDF Printing From FileMaker WebDirect – A New Approach – FileMaker Today


Here is this weekends featured blog from our friends at Core Solutions in Toronto Canada…be sure and sign up for the Core Solutions Newsletter after reading! After working on a solution that eventually became FileMaker WebDirect-ified, it became quite evident that we needed to find a way to do reporting from web-based clients. As most of you are probably already aware, the very useful “Save as PDF” script step that FileMaker Pro provides is not available to clients accessing your system via Web Direct. There are a number of solutions to this problem already, but I had problems getting some of them to work, and others didn’t quite fit the bill.


As a result of this dilemma, I decided to roll on my own – I ended up creating a module that is relatively easy to implement, flexible, and even allows you to reuse your existing reporting scripts should you find yourself in a situation similar to mine.


How to Install this Module


  1. Copy tables



  2. Copy custom functions



  3. Clean up the layouts that are automatically created (delete everything but the “Container” field, make the layout blend in with your system, and make that container field take up the majority of the screen)



  4. Copy the main script folder (Perform Script On Robot) from sample solution into yours



  5. Create a new account in your system to be used by the robot. The default account name is “Robot”, though this can be changed in the config file



  6. Modify the “PSOR Config” script (Optional)



  7. Attach the “PSOR On Record Load – Look For New Jobs” script as an On Record Load script trigger on the “PSOR_ActiveJobs” layout



  8. Attach the “PSOR On First Window Open” and “PSOR On Last Window Close” as script triggers on the file



  9. Login to the system with your “Robot” account from FileMaker Pro on the robot machine


Once installed, the solution can be very simple to implement. To understand how to implement it, you should keep in mind that the goal of this module was twofold; to be able to create PDF’s seemingly from WebDirect and to be able to reuse the same scripts that create those PDF’s from FileMaker Pro clients. After all, who likes rewriting code to do the same thing multiple times?


Keeping that in mind, with just a couple of simple additions, every one of your scripts that generates a PDF file can probably be modified so that it can be run from your Robot machine as well.


  1. Each one of those scripts will need a section at the top that determines if the script should continue running, or be handed off to the robot to continue (see sample file for details on this)

    #IF THIS IS BEING RUN FROM WEB-DIRECT, HAVE THE ROBOT MACHINE RUN THIS SCRIPT INSTEAD

    IF [ $$IAMWEBDIRECT ]

    PERFORM SCRIPT [ “PSOR - ASK ROBOT TO RUN THIS” ;

              PARAMETER: INFOFORROBOT__CF ( )GO

              //& NAMEVALUEPAIR_BROWSE__CF ( _NAME ; _VALUE )

              //& NAMEVALUEPAIR_FIND__CF ( _NAME ; _VALUE ) ]

    END IF

    #ROBOT MACHINE RUNS EVERYTHING UNDER THIS LINE, AND SHOULD EXIT WITH THE PATH TO THE PDF THAT WAS CREATED




  2. Each one of those scripts should create a PDF (or some kind of file), and exit the script with a result representing the path to that newly created file


If everything went smoothly, then anytime you try to run one of your newly modified scripts from WebDirect, the handoff should take place, and the user will be left on a screen that displays the PDF.


If you’re interested in the actual solution, you can download it here.


If you enjoy these FileMaker Blogs, be sure to subscribe to our Core FileMaker Newsletter!


Have any questions or comments about this solution? Have anything you would like to add or change? Feel free to let us know by clicking our link below.


And as always, Thanks For Reading,


To see more great blogs from Core Solutions – Tap or Click here

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy