1 2 3 4 Previous Next 45 Replies Latest reply on Nov 21, 2016 3:02 PM by dburnham

    Printing and exporting in WebDirect

    victorsanjuan

      I've been working with webdirect last days and its great, but I found a big problem. It's not possible to export pdf or print reports.

      This is a very big problem to use it in my customer solutions. Who wants work with a solution that cannot export pdf or print reports ??? It's disapointing !!

      Anyone knows how to export or print using webdirect ??

        • 1. Re: Printing and exporting in WebDirect
          mikebeargie

          you can use the "perform script on server" script step to generate PDFs that store in a container field. Then I believe "export field contents" is compatible to save that PDF to your desktop.

           

          As always with ANY new software solution, do your research first before diving in and you can avoid some headaches.

           

          This article stated that Filemaker Pro is better at webdirect to:

          • Print complex, multi-page reports

           

          http://help.filemaker.com/app/answers/detail/a_id/11998/kw/webdirect/related/1

          • 2. Re: Printing and exporting in WebDirect
            jasongodoy

            Hi victorsanjuan,

             

            I feel your pain, but here's an idea for printing (PDFs only).

             

            Why not try using a web viewer to display a PDF inside the WebDirect application?

             

            I haven't tested this, but my thinking is that if the user has a PDF viewer installed for their particular browser (independent of FM WebDirect), perhaps the PDF will display in the web viewer and the typical PDF navigation and print controls will be available.  Essentially, native printing (at least from the users point of view).

             

            As far as "Save Records As PDF" goes, I'm not sure that the "Perform Script On Server" script step will work to generate a PDF, because Save Records As PDF is a server compatible script step.

             

            Let us know what your find.

             

            - Jason

            • 3. Re: Printing and exporting in WebDirect
              datastride

              Victor,

               

               

               

              Caveat: The solution I am describing is a work in progress … but from the results we have achieved to date, it seems highly likely to solve this problem …

               

               

               

              Not only can one not create PDFs from FMWebDirect, but neither can one create PDFs from a server-side script or from a script invoked by Custom Web Publishing. The script step “Save records as PDF” in not supported for these situations.

               

               

               

              After thinking about this issue for some time, we came up with this solution to provide a consistent approach to reporting across all FileMaker access methods (Pro, Go, CWP, and FMWebDirect):

               

               

               

              1.       On the machine that hosts FileMaker Server, each time the server is booted up,  we start up a “headless” process to run FileMaker Pro (an extra FileMaker Pro license required, of course). (This is our “robot” process.)

               

               

               

              2.       When the robot process starts up, it begins “listening” for requests to produce PDFs. (I’ll explain “listening” later.)

               

               

               

              3.       When an FMWebDirect user needs a report, we run a normal script that invokes a server-side script (because such a server-side script can use plug-ins) to “send” a request to the robot process. The request includes all the details needed to produce the report (print layout name, record selection criteria, sorting criteria, name of the script that can produce the report, etc.).

               

               

               

              4.       The robot “hears” the request, and uses a highly-abstracted script to produce the report and save the results to a PDF file.

               

               

               

              5.       The robot then moves the PDF file into a remote container field in a table we called “Documents”. (The primary key to the record where the PDF is to be stored was returned to the FMWebDirect user’s script that submitted the request.)

               

               

               

              6.       The FMWebDirect user’s script has been checking periodically for the presence of something in the remote container field (i.e. the PDF).

               

               

               

              7.       Once the FMWebDirect user’s script sees that the PDF has been created, it switches to a generic layout that displays the PDF (so the user can view or print or save it).

               

               

               

              This process relies on plug-ins to solve two problems that native FileMaker cannot handle:

               

               

               

              First, we use a plug-in to “send” requests and to “listen” for requests” (between the server-side script and the robot process) using an agreed upon port number.  And second, we need to be able to run a script by name (e.g. the name of the script that produces any given report is one of the parameters passed with each request), as this is crucial to the “abstraction” methodology used to support this whole endeavor.

               

               

               

              We had chosen Troi Activator to handle both of the above tasks, but we ran into the problem that this plug-in is not yet available in a 64-bit version for use on a Windows Server 2008 or 2012 box (the OS we prefer for hosting FileMaker databases). (uch a version is available for Mac OS X, I understand.) Thus we will probably have to switch to a different plug-in for this portion of the solution. But even so, we were able to prototype the process as proof-of-concept. Now we just have to get Troi to deliver a 64-bit plug-in or switch to the MBS plug-in (Moneybread) or the RemoteScripter plug-in (360Works) or something else.

               

               

               

              I have been told that the reason the server-side scripts cannot create PDFs is that this process has no awareness of, nor support for, the graphical aspects of layouts.  And this appears to be the case with FMWebDirect. Clearly the “virtual FileMaker client” stuff that runs on the server knows something about the graphical aspects of layouts, as it has to pass some HTML and CSS to a web browser to render each layout. But that doesn’t mean it has any logic of its own to render layouts using that same HTML and CSS. Thus still no easy way for these “virtual clients” to format the content that would go into a  PDF.

               

               

               

              Now I know that the process I’ve described above is not as simple or elegant as I would like, but I cannot see any other solution at this point. Only FM Pro and FM Go can create PDFs from FileMaker print layouts. That said, I suspect the announcement of FMWebDirect will put enormous pressure on FileMaker, Inc. to provide a solution. And, it seems to me, such is the history of FileMaker’s evolution. One version introduces a cool new feature, but without all the capabilities such a new feature needs to be fully utilized, and then the next version of FileMaker catches us up with that additional support. Take, for example, Themes as provided in FM 12 and the much more robust support for Themes in FM 13.

               

               

               

              So I’m guessing in a year or two, we’ll be able to rip out this homegrown “remote report generation” scheme and substitute something much simpler and more elegant. But the abstraction we had to create for now should still server us well with such a future scheme, so we should be able to continue to reap dividends from the investment in implementing the current approach.

               

               

               

              I’d love to hear from others with any better (or just alternate) ideas … This is a problem that many of us will have to deal with until FileMaker 14 comes along, so I am hopeful that we, the super-intelligent and extremely-good-looking FileMaker developers on this forum can pool our creativity to arrive at an optimum “workaround”.  

               

                                                         

               

              #end

               

              Peace, love & brown rice,

               

              Morgan Jones

               

               

               

              FileMaker + Web:  Design, Develop & Deploy

               

              Certifications: FileMaker 9, 10, 11 & 12

               

              Member: FileMaker Business Alliance

               

              One Part Harmony <http://www.onepartharmony.com/>  

               

              Austin, Texas • USA

               

              512-422-0611

              • 5. Re: Printing and exporting in WebDirect
                jrenfrew

                Alternative and better, but with a steeper learning curve, and one we are actively employing where it is right to make some complex PDF files is to write tehm from scratch using a library like iText with ScriptMaster as a server script.

                 

                Not only can I do this quicker on a local machine than the printing engine can I can do things like create bookmarks and do concatenation and page numbering.

                 

                 

                john

                • 6. Re: Printing and exporting in WebDirect
                  ryantittle

                  We are using a similar process, but with no third party plugins.

                  We have a special reports table to hold report criteria ( Table, Layout, IDs of found set, list vs. individual, pdf vs excel, etc.)

                  A new record is created everytime someone needs a report.

                  A Filemaker Pro Client on the server is running a looping script at all times checking for new records in the report table that do not have a Report Created Timestamp.

                  When one is found, it goes to the appropriate layout/records saves the PDF, sets the Timestamp, and can either insert it into a container field, or, more often, we then make the pdf available through a web viewer, where it can easily be downloaded or printed. Despite a constantly running script, we really haven't seen any significant increase in overhead, and are running reports for multiple files.

                  • 7. Re: Printing and exporting in WebDirect
                    datastride

                    Thanks for the link, Ibrahim. Good to know about …

                     

                     

                     

                    But I’m wanting to simply “print” regular FileMaker reports to a PDF that I can then view or print in my FMWebDirect or CWP session.

                     

                     

                     

                    I believe my solution will make it possible to use all existing “print” layouts without modification. And that’s my goal. I know I can create PDFs from scratch, but not anywhere near as quickly as I can whip out a FileMaker report layout …

                     

                     

                     

                    #end

                     

                    Peace, love & brown rice,

                     

                    Morgan Jones

                     

                     

                     

                    FileMaker + Web:  Design, Develop & Deploy

                     

                    Certifications: FileMaker 9, 10, 11 & 12

                     

                    Member: FileMaker Business Alliance

                     

                    One Part Harmony <http://www.onepartharmony.com/>  

                     

                    Austin, Texas • USA

                     

                    512-422-0611

                    • 8. Re: Printing and exporting in WebDirect
                      datastride

                      John,

                       

                       

                       

                      In my tests using the method I described (a robot process running FileMaker Pro), report generation is extremely fast. Because the robot process is running on the same box as FileMaker server (as a “headless” process), things happen very, very quickly, and then only the resulting PDF needs to be opened by FMWebDirect.

                       

                       

                       

                      By the way, this method also seems to offer benefits for FM Go clients, as report generation happens so much more quickly.

                       

                       

                       

                      #end

                       

                      Peace, love & brown rice,

                       

                      Morgan Jones

                       

                       

                       

                      FileMaker + Web:  Design, Develop & Deploy

                       

                      Certifications: FileMaker 9, 10, 11 & 12

                       

                      Member: FileMaker Business Alliance

                       

                      One Part Harmony <http://www.onepartharmony.com/>  

                       

                      Austin, Texas • USA

                       

                      512-422-0611

                      • 9. Re: Printing and exporting in WebDirect
                        datastride

                        Ryan,

                         

                         

                         

                        I am likewise seeing that my robot process consumes so little CPU and memory (on an industrial-strength server), that we don’t even notice it’s there …  

                         

                         

                         

                        #end

                         

                        Peace, love & brown rice,

                         

                        Morgan Jones

                         

                         

                         

                        FileMaker + Web:  Design, Develop & Deploy

                         

                        Certifications: FileMaker 9, 10, 11 & 12

                         

                        Member: FileMaker Business Alliance

                         

                        One Part Harmony <http://www.onepartharmony.com/>  

                         

                        Austin, Texas • USA

                         

                        512-422-0611

                        • 10. Re: Printing and exporting in WebDirect
                          jrenfrew

                          If you are using a robot process are you importing back into the file using the robot or a server script??

                           

                          john

                          • 11. Re: Printing and exporting in WebDirect
                            datastride

                            John,

                             

                             

                             

                            I tried to explain this in my earlier (lengthy) description. Sorry if my explanation was not more understandable.

                             

                             

                             

                            The robot inserts the PDF into a Remote Container field in a table called Documents. The primary key to the Document record was previously provided to the FMWebDirect’s script before the robot was sent the request to create the PDF. The robot receives this key as one of the parameters in the request, so it knows the agreed upon spot to store the PDF.

                             

                             

                             

                            I use the robot, as the server-side script does not have access to the same folders and files as the robot.

                             

                             

                             

                            Does this make sense?

                             

                             

                             

                            #end

                             

                            Peace, love & brown rice,

                             

                            Morgan Jones

                             

                             

                             

                            FileMaker + Web:  Design, Develop & Deploy

                             

                            Certifications: FileMaker 9, 10, 11 & 12

                             

                            Member: FileMaker Business Alliance

                             

                            One Part Harmony <http://www.onepartharmony.com/>  

                             

                            Austin, Texas • USA

                             

                            512-422-0611

                            • 12. Re: Printing and exporting in WebDirect
                              AndyCohen

                              Morgan

                              Thanks for posting the robot approach. Unfortunately its a but too complex for most of us or has limtiations. I also agree with your comment about how FMI has done things kinda half baked then in their later versions attempt to complete them... but I think this time around we all need to question the business sense of making a new release without report printing via webdirect. This lack of report output has been with us for more then one version... i.e., IWP, & CWP. FMI knows full well that almost 90% of all the applications built in FMP ALWAYS require hard copy output. It is quite likely that a very large amount of money went into the development of webdirect.

                              There are also other things about webdirect which one has to wonder about. Have you seen the HW requirements per concurrent users yet?! 12 cores per 50 concurrent users?!

                              IMO FMI should not have released a new product without the features that are obviously needed for the use cases that are already well defined by the current applications of FMP. This is now the second released version where we all have to wonder about the logic and capabilities of those calling the shots at FMI.

                              • 13. Re: Printing and exporting in WebDirect

                                WebDirect does offer more and better ways of creating records in a reporting table that can be picked up by a robot with a looping script. Just like what Ryan has mentioned:

                                 

                                For standard user requested reports, it is easy for the script to create a new record in a reporting table and set the table, key fields, layout used for report, sort order, header, etc. We have been using such a method for a decade with great success, and for the most part it is not that complex. It does have to be monitored to avoid problems when a client restarts the server.

                                 

                                For other reports (such as an email of PDF when a new record has been created,) WebDirect does make this easier with better use of script triggers to create a new report record. But, the lack of native WebDirect PDF creation (and some extremely odd lack of native field character and length checking) does remiain a mystery.

                                 

                                If you want an example of a simple PDF robot, let us know and we can get some instructions to you.

                                • 14. Re: Printing and exporting in WebDirect
                                  datastride

                                  Andy,

                                   

                                  I think the reality is that FM 13 needed to ship a new version at some point, and FileMaker has obviously invested heavily in this new release. I think they just had to cut off the list of new features somewhere, or it never would have gotten out the door.

                                   

                                  FileMaker has have created an incredible capability in FMWebDirect. I, for one, am amazed and delighted with this new feature, as it opens up a bunch of opportunities. Just think, if we didn't have FMWebDirect, we wouldn't even be talking about needing to create PDFs from same. And it points very clearly to a new direction (and no doubt, a new code base) for the product line.

                                   

                                  I feel fairly confident that the next version will plug this obvious hole. And I expect performance will get tweaked over time so as to require less hardware for a given set of users. Oh, and besides, the hardware gets more and more powerful even while getting cheaper and cheaper every year.

                                   

                                  Anyway, I feel like FMWebDirect is a winner ... even though I acknowledge that it isn't "perfect."

                                  1 2 3 4 Previous Next