3 Replies Latest reply on Jan 17, 2011 1:33 PM by philmodjunk

    Selecting fields and reporting in FM Go



      Selecting fields and reporting in FM Go



      I am trying to give reporting functionality to my execs via FM Go/iPad in order for them to get the same visibility through the iPad as they would get using a regular computer. So I have a couple of questions on how to go about this.

      Currently in order to select date ranges, offices, etc we utilize a third party plugin named WinDialog. I understand that third party plugins are not used within FM Go so I have created a new layout for the mobile users.

      The goal would be either one of the following two things:

      Option 1: 

      Select date range

      Select office or "all" (if applicable)

      Select product or "all" (if applicable)

      Select report (required)

      Hit "Run Report"

      Output natively


      Option 2:

      Selection of the same fields as above with the only difference being that the output is PDF which might be easier to read on an iPad.

      So this is my project. All the examples I have encountered so far deal with browsing records. That functionality is working fine with zero programming. But the reporting is where the true power of this application is at and I want to capture this with FM Go.

      Thank you.


        • 1. Re: Selecting fields and reporting in FM Go

          A classic approach used in FileMaker Pro that should also work for GO is to define a series of global fields for each of the items above, then click a button to perform a script that uses the data entered into the global fields to perform a find to locate and display the desired records. Each global field can be formatted with value lists and other features to assist the user in selecting criteria for the find.

          Here's sample script that just uses a date range and a selected "office" value. (add more steps to include the other criteria you specify.)

          Go To Layout [//select layout designed to display your data in report format]
          Enter Find Mode[]
          Set Field [YourTable::DateField ; YourTable::gDate1 & "..." & YourTable::gDate2 ]
          Set Field [YourTable::Office ; If ( YourTable::gOffice = "All" ; "" ; YourTable::gOffice ) ]
          Set Error Capture [on]
          Perform find[]
          Sort[Restore] // may or may not be needed, depending on design of report layout

          Each of the fields whose name starts with a 'g' must be defined as fields with global storage in order for this script to work.

          • 2. Re: Selecting fields and reporting in FM Go

            Is there a way I can have the report also as a variable? Currently I have a script that determines the layout based on the script parameter after "Run Report". 


            If [$Report = "Pending Jobs"]

            Go to Layout ["Outstanding Jobs" (Contracts)]

            Perform Script ["Set Page Layout Landscape"]

            Sort Records [Restore; No dialog;]

            Set Field [$ReportTitle; "Pending Jobs Report"]


            So do you see a reason I cannot incorporate the above in the script, always thinking towards iPad functionality?

            Many thanks for your help. 

            • 3. Re: Selecting fields and reporting in FM Go

              As long as the layouts specified in the variable all refer to layouts upon which the find can be performed successfully, there should be no problem.

              Example:  if I assume that your pending jobs report uses a layout that refers to a Table Occurrence called "Jobs" in layout setup..., then I can write the find script to perform the search by entering data into fields in "jobs" and any records related to "jobs". If I specify a layout that refers to "contacts" in layout setup, this won't work as the find will fail. Even a layout that refers to "Jobs 2" or some other Table Occurrence that refers to the same data-source table may not work as expected.

              Note: a "Table Occurrence" is one of the boxes found in Manage | Database | Fields. These "boxes" control what data may be displayed, manipulated from a given layout based on which one is specified in "Show Records From" in Layout Setup...

              Tutorial: What are Table Occurrences?