4 Replies Latest reply on Aug 14, 2012 7:46 PM by MichaelWeisenberg

    Placing a calculation directly on a layout

    MichaelWeisenberg

      Title

      Placing a calculation directly on a layout

      Post

      Is there any way to enter a calculation or calculated field directly on to a layout without first adding the calculated field to a table? I have a field on one of my tables that I would want to add to a report layout but I would want to modify the field on the layout by dividing by 270 i.e. "field name"/270. I know I can drag a calculated field from one of my tables to my layout but, for various reasons, it would be easier for me to modify my field directly on my layout with a calculation if this were possible in FMP. In looking at the various layout tools such as edit boxes, etc., there does not appear to be any tool that would allow you to modify an edit box by adding a calculation to a field and no place in the data tab of the inspector to do this either. Please let me know if there is any way to do this. Thanks.

      michaelxjw

        • 1. Re: Placing a calculation directly on a layout
          davidanders

          If you have a field in the layout's table called FirstName, you can add it to a layout with  <<FirstName>>.

          This can be resized and font formatted, it show the contents of the FirstName field for that record.

          A field on a related Table can be displayed with <<Other Table::FieldName>>

          Any calculations on FirstName would be done in a calculation field then displayed with <<FirstNameCalc>>

          http://www.filemaker.com/help/html/create_layout.9.23.html

          To place a merge field on a layout:
          1.
          In Layout mode, do one of the following:
            •
          To create a new text block containing a merge field, click with the arrow pointer where you want the text block to appear.
            •
          To insert a merge field into an existing text block, click the Text toolText tool in the status toolbar, then click in the text block to place the insertion point where you want to insert the merge field.
          2.
          Choose Insert menu > Merge Field.
          3.
          In the Specify Field dialog box, select the field to insert.
          To choose a field in a related table, choose the table from the tables list above the list of fields. Or choose Manage Database to create a new field, table, or relationship.
          4.
          Click OK.
          You see the field name enclosed by double opening (<<) and closing (>>) angle brackets in the text block.
          To remove a merge field: Select the field name along with the << and >> symbols, then press Backspace or Delete.
          • 2. Re: Placing a calculation directly on a layout
            philmodjunk

            If you have FileMaker 11 or newer, t is possible to do this with a variable added to your layout as a "merge variable", but I'm not fully enthusiastic about this method:

            Add some layout text to your layout such as "I Declare variables".

            Give it this conditional format expression:

            Let ( $Calculation = YourTable::YourNumberField / 270 ; True )

            Select a font size of 500 for this conditional format. (This hides the layout text from view when you are in browse, preview or find modes, but not when in Layout mode.)

            Now select the Layout Text Tool and click the layout where you want to see this calculated value.

            Enter this text as your layout text: <<$Calculation>>

            • 3. Re: Placing a calculation directly on a layout
              MichaelWeisenberg

              Phil,

               

              Thanks!  Your suggestion worked for me.

               

              michaelxjw

              • 4. Re: Placing a calculation directly on a layout
                MichaelWeisenberg

                David,

                While you did not directly address my question (I was referring to placing a calculation directly into a layout- not from a table), your suggestion, similar to that of Phil, to use a merge field, pointed me in the right direction. Thanks.

                michaelxjw