Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Tables

All examples are included with download of MBS FileMaker Plugin.

Tables.fmp12

Overview
Tables 2
Relationships 0
Layouts 2
Scripts 7
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Minimalist
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
Tables
1 field defined, 1 record
Tables
Images
1 field defined, 17 records
Images

Fields

Table Name: Tables - 1 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
OutputPDF Normal, Binary Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1

      Table Name: Images - 1 Fields
      Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
      Image Normal, Binary Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1

          Layout Objects: Tables

          Regular Fields

          Field Name: Tables::OutputPDF
          Field Properties Coordinates Field Format Field Behavior Quick Find
          • Top: 24 pt
          • Left: 138 pt
          • Bottom: 521 pt
          • Right: 553 pt
          • Anchoring: Left and Right, Top and Bottom
          Field Format:
          • Edit Box
          Field Behavior:
          • Allow field to be entered: In Find mode, In Browse mode
          • Touch keyboard type: System Default
          • Go to next field using: Tab key
          No

          Buttons

          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Create Text Table
          • Top: 26 pt
          • Left: 566 pt
          • Bottom: 51 pt
          • Right: 729 pt
          • Anchoring: Right, Top
          Perform Script [ “CreateTextTable” ]

          Scripts:


          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Create Image Table
          • Top: 59 pt
          • Left: 566 pt
          • Bottom: 85 pt
          • Right: 729 pt
          • Anchoring: Right, Top
          Perform Script [ “CreateImageTable” ]

          Scripts:


          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Create Template Table
          • Top: 93 pt
          • Left: 566 pt
          • Bottom: 119 pt
          • Right: 729 pt
          • Anchoring: Right, Top
          Perform Script [ “CreateTemplateTable” ]

          Scripts:


          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Create Calendar Table
          • Top: 127 pt
          • Left: 566 pt
          • Bottom: 153 pt
          • Right: 729 pt
          • Anchoring: Right, Top
          Perform Script [ “CreateCalendarTable” ]

          Scripts:


          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Create Font Table
          • Top: 161 pt
          • Left: 566 pt
          • Bottom: 187 pt
          • Right: 729 pt
          • Anchoring: Right, Top
          Perform Script [ “CreateFontTable” ]

          Scripts:


          Layout Objects: Images

          Regular Fields

          Field Name: Images::Image
          Field Properties Coordinates Field Format Field Behavior Quick Find
          • Top: 24 pt
          • Left: 138 pt
          • Bottom: 251 pt
          • Right: 547 pt
          • Anchoring: Left, Top
          Field Format:
          • Edit Box
          Field Behavior:
          • Allow field to be entered: In Find mode, In Browse mode
          • Touch keyboard type: System Default
          • Go to next field using: Tab key
          No

          Script Hierarchy

          CreateTextTable
          CreateImageTable
          CreateTemplateTable
          CreateCalendarTable
          InitDynaPDF
          CreateFontTable
          Clean

          Next Script: [CreateImageTable]
          Script Name CreateTextTable
          Run script with full access privileges Off
          Siri Shortcut Visible Off
          Include In Menu Yes
          Layouts that use this script
          Scripts that use this script
            Script Definition
            Script Steps
            Fields used in this script
            Scripts used in this script
            Layouts used in this script
              Tables used in this script
              Table occurrences used by this script
              Custom Functions used by this script
                Custom menu set used by this script

                  Previous Script: [CreateTextTable] Next Script: [CreateTemplateTable]
                  Script Name CreateImageTable
                  Run script with full access privileges Off
                  Siri Shortcut Visible Off
                  Include In Menu Yes
                  Layouts that use this script
                  Scripts that use this script
                    Script Definition
                    Script Steps
                    Fields used in this script
                    Scripts used in this script
                    Layouts used in this script
                    Tables used in this script
                    Table occurrences used by this script
                    Custom Functions used by this script
                      Custom menu set used by this script

                        Previous Script: [CreateImageTable] Next Script: [CreateCalendarTable]
                        Script Name CreateTemplateTable
                        Run script with full access privileges Off
                        Siri Shortcut Visible Off
                        Include In Menu Yes
                        Layouts that use this script
                        Scripts that use this script
                          Script Definition
                          Script Steps
                          • #Initialize DynaPDF if needed
                          • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                          • Perform Script [ “InitDynaPDF” ]
                          • End If
                          • #Find dynapdf_help.pdf
                          • Set Variable [ $databasePath; Value:Get(FilePath) ]
                          • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                          • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                          • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                          • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf_help.pdf" ) ]
                          • #Clear current PDF document
                          • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.SetPageCoords"; $pdf; "TopDown") ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromFile"; $pdf; $path) ]
                          • Set Variable [ $pageCount; Value:MBS("DynaPDF.GetImportPageCount"; $pdf) ]
                          • Set Variable [ $pageCount; Value:20 ]
                          • If [ GetAsNumber($pageCount)>0 ]
                          • #Create Table
                          • Set Variable [ $table; Value:MBS("DynaPDF.Table.Create"; $pdf; $pageCount/4+1; 2; 512,12; 0) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetBorderWidth"; $table; -1; -1; 1; 1; 1; 1) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetCellPadding"; $table; -1; -1; 5; 5; 5; 5) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetGridWidth"; $table; 1; 1) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetFlags"; $table; -1; -1; "ScaleToRect") ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.SetPageFormat"; $table; "US Letter") ]
                          • #Add Rows
                          • Set Variable [ $rowCount; Value:0 ]
                          • Set Variable [ $i; Value:1 ]
                          • Set Variable [ $x; Value:0 ]
                          • Loop [ Flush: Always ]
                          • Set Variable [ $tmpl; Value:MBS("DynaPDF.ImportPageAsTemplate"; $pdf; $i) ]
                          • If [ $x = 0 ]
                          • Set Variable [ $rowNum; Value:MBS("DynaPDF.Table.AddRow"; $table; 335) ]
                          • End If
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetCellTemplate"; $table; $rowNum; $x; 1; "center"; "center"; $tmpl; 0; 0) ]
                          • Set Variable [ $x; Value:If($x = 0; 1; 0) ]
                          • Set Variable [ $i; Value:$i + 1 ]
                          • Exit Loop If [ $i > $pageCount ]
                          • End Loop
                          • #Draw Table
                          • Set Variable [ $r; Value:MBS("DynaPDF.AppendPage"; $pdf) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.Draw"; $table; 50; 50; 742) ]
                          • If [ MBS("DynaPDF.Table.HaveMore"; $table) ]
                          • Loop [ Flush: Always ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.EndPage"; $pdf) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.AppendPage"; $pdf) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.Draw"; $table; 50; 50; 742) ]
                          • Exit Loop If [ MBS("DynaPDF.Table.HaveMore"; $table) ≠ 1 ]
                          • End Loop
                          • End If
                          • Set Variable [ $r; Value:MBS("DynaPDF.EndPage"; $pdf) ]
                          • End If
                          • #Cleanup
                          • Set Field [ Tables::OutputPDF; MBS("DynaPDF.Save"; $pdf) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Table.Release"; $table) ]
                          • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                          Fields used in this script
                          Scripts used in this script
                          Layouts used in this script
                            Tables used in this script
                            Table occurrences used by this script
                            Custom Functions used by this script
                              Custom menu set used by this script

                                Previous Script: [CreateTemplateTable] Next Script: [InitDynaPDF]
                                Script Name CreateCalendarTable
                                Run script with full access privileges Off
                                Siri Shortcut Visible Off
                                Include In Menu Yes
                                Layouts that use this script
                                Scripts that use this script
                                  Script Definition
                                  Script Steps
                                  • #Initialize DynaPDF if needed
                                  • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                  • Perform Script [ “InitDynaPDF” ]
                                  • End If
                                  • #Clear current PDF document
                                  • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.SetPageCoords"; $pdf; "TopDown") ]
                                  • Set Variable [ $i; Value:0 ]
                                  • Set Variable [ $pageCount; Value:0 ]
                                  • Set Variable [ $RowCount; Value:0 ]
                                  • #Create Table
                                  • Set Variable [ $table; Value:MBS("DynaPDF.Table.Create"; $pdf; 32; 13; 500; 9) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetBorderWidth"; $table; -1; -1; 1; 1; 1; 1) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetGridWidth"; $table; 1; 1) ]
                                  • #Add Rows
                                  • Set Variable [ $rowNum; Value:MBS("DynaPDF.Table.AddRow"; $table) ]
                                  • Set Variable [ $rowNum; Value:MBS("DynaPDF.Table.SetFlags"; $table; 0; -1; "HeaderRow") ]
                                  • Set Variable [ $months; Value:"Jan¶Feb¶Mar¶Apr¶May¶Jun¶Jul¶Aug¶Sep¶Oct¶Nov¶Dec" ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Table.SetCellText"; $table; $rowNum; 0; "center"; "center"; "Day") ]
                                  • Set Variable [ $r; Value:MBS("FM.Loop"; /* variable */ "index"; /* start */ 1; /* end */ 12; /* step */ 1; /* formula */ "MBS(\"DynaPDF.Table.SetCellText\"; $table; $rowNum; index; \"center\"; \"center\"; GetValue($months; index))") ]
                                  • #Add Rows
                                  • Set Variable [ $r; Value:MBS("FM.Loop"; /* variable */ "index"; /* start */ 1; /* end */ 31; /* step */ 1; /* formula */ "Let([$rowNum = MBS(\"DynaPDF.Table.AddRow\"; $table); r = MBS(\"DynaPDF.Table.SetCellText\"; $table; $rowNum; 0; \"center\"; \"center\"; index)]; r)") ]
                                  • Set Variable [ $text; Value:"The cell alignment can be set for text, images, and templates..." ]
                                  • #Draw Table
                                  • Set Variable [ $r; Value:MBS("DynaPDF.AppendPage"; $pdf) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Table.Draw"; $table; 50; 50; 742) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.EndPage"; $pdf) ]
                                  • #Cleanup
                                  • Set Field [ Tables::OutputPDF; MBS("DynaPDF.Save"; $pdf) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Table.Release"; $table) ]
                                  • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                                  Fields used in this script
                                  Scripts used in this script
                                  Layouts used in this script
                                    Tables used in this script
                                    Table occurrences used by this script
                                    Custom Functions used by this script
                                      Custom menu set used by this script

                                        Previous Script: [CreateCalendarTable] Next Script: [CreateFontTable]
                                        Script Name InitDynaPDF
                                        Run script with full access privileges Off
                                        Siri Shortcut Visible Off
                                        Include In Menu No
                                        Layouts that use this script
                                          Scripts that use this script
                                          Script Definition
                                          Script Steps
                                          • #Locate DynaPDF library
                                          • #you can have libraries in container and export at runtime to folder of your choice.
                                          • #Or install library somewhere and pass path.
                                          • #If library is in same folder as plugin, you can only pass only file name.
                                          • If [ MBS("IsServer") ]
                                          • #Put the path you use for your server here:
                                          • If [ Get(SystemPlatform) = -2 ]
                                          • #Server on Windows
                                          • Set Variable [ $path; Value:"C:\Programs\FileMaker Server\dynapdf.dll" ]
                                          • Else If [ MBS("IsLinux") ]
                                          • #Server on Linux for FileMaker Cloud
                                          • Set Variable [ $path; Value:"/opt/FileMaker/FileMaker Server/dynapdf.linux.so" ]
                                          • Else [ ]
                                          • #Server on Mac
                                          • Set Variable [ $path; Value: "/Library/FileMaker Server/dynapdf.dylib" ]
                                          • End If
                                          • Else [ ]
                                          • #For desktop and our examples we look in same folder as database:
                                          • Set Variable [ $databasePath; Value:Get(FilePath) ]
                                          • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                                          • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                                          • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                                          • If [ Get(SystemPlatform) = -2 ]
                                          • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dll" ) ]
                                          • #plugin will look for dynapdf.dll and if not found also for dynapdf.dll (64-bit) and dynapdf32.dll (32-bit).
                                          • Else [ ]
                                          • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dylib" ) ]
                                          • #Mac dylib is usually 32 and 64 bit together.
                                          • End If
                                          • End If
                                          • #You can test for free.
                                          • #If you like to get a dynapdf license, please follow links on our pricing page:
                                          • #https://www.monkeybreadsoftware.de/filemaker/pricing.shtml
                                          • Set Variable [ $LicenseKey; Value:"" // put your key here or leave empty for demo. // Use e.g. "Lite", "Pro" or "Starter" to use demo mode for just that mode. ]
                                          • Set Variable [ $r; Value:MBS( "DynaPDF.Initialize"; $path; $LicenseKey) ]
                                          • If [ $r ≠ "OK" ]
                                          • Show Custom Dialog [ Title: "Error"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                                          • Halt Script
                                          • End If
                                          • #we request bigger previews
                                          • Set Variable [ $r; Value:MBS("Plugin.SetPreviewSize"; 2000) ]
                                          Fields used in this script
                                            Scripts used in this script
                                              Layouts used in this script
                                                Tables used in this script
                                                  Table occurrences used by this script
                                                    Custom Functions used by this script
                                                      Custom menu set used by this script

                                                        Previous Script: [InitDynaPDF] Next Script: [Clean]
                                                        Script Name CreateFontTable
                                                        Run script with full access privileges Off
                                                        Siri Shortcut Visible Off
                                                        Include In Menu Yes
                                                        Layouts that use this script
                                                        Scripts that use this script
                                                          Script Definition
                                                          Script Steps
                                                          Fields used in this script
                                                          Scripts used in this script
                                                          Layouts used in this script
                                                            Tables used in this script
                                                            Table occurrences used by this script
                                                            Custom Functions used by this script
                                                              Custom menu set used by this script

                                                                Previous Script: [CreateFontTable]
                                                                Script Name Clean
                                                                Run script with full access privileges Off
                                                                Siri Shortcut Visible Off
                                                                Include In Menu Yes
                                                                Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • Set Field [ Tables::OutputPDF; "" ]
                                                                    Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                        Table occurrences used by this script
                                                                        Custom Functions used by this script
                                                                          Custom menu set used by this script

                                                                            Download example: Tables

                                                                            Used functions: