3 Replies Latest reply on Mar 31, 2014 6:04 AM by philmodjunk

    Hide When Printing Script?

    SeanMcCluskey

      Title

      Hide When Printing Script?

      Post

           Hello, I'm trying to find out if there is a way to make a script to hide when printing. What I would like to do is say when "field1" = Yes allow "field2", "field3", "field4", etc. to print. When "field1" = No "field2, field3, and field4" will be hidden from printing.

           Is this possible?

        • 1. Re: Hide When Printing Script?
          SteveMartino

               Depends on how things are laid out.  One way that comes to mind

               1. On your script, when field 1 = yes, set a flag field (doesn't have to be on layout) to = 1 (checkbox set, one value in value list 1)

               2. Set conditional formatting for fields 2, 3, 4 so when flag field = 1 (flag field value in value list tied to checkbox set), change field color to invisible (or match background color)

               When you close layout, or after printing in the script, reset flag field to ""

          • 2. Re: Hide When Printing Script?
            SeanMcCluskey

                 That may work but the trick is I want to get rid of the blank space when printing. So I need a script that hides the fields and moves the fields below it up into place. 

            • 3. Re: Hide When Printing Script?
              philmodjunk

                   No script is needed.

                   If this is FileMaker 13, put this expression into the "hide when" box in the Inspector while these fields are selected in layout mode:

                   ( Get ( WindowMode = 3 ) or Get ( WindowMode ) = 2 ) And YourTable::field1 = "Yes" )

                   This will hide the selected fields in preview or print window modes if field1 = "yes".

                   Then use the sliding and visibility settings on the Inspector's position tab to set the fields to "slide up" and to "resize enclosing part".

                    

                   Key facts about sliding layout objects:

                     
              1.           It's only visible in preview mode and when you print/save as PDF...
              2.      
              3.           Sliding fields will shrink but not expand.
              4.      
              5.           All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
              6.      
              7.           Objects in headers and footers will not slide.
              8.      
              9.           Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
              10.      
              11.           Fields will slide up only if Top alignment is specified for it and will slide left only if Left alignment is specified.
              12.      
              13.           Consistent side borders are difficult to achieve with sliding fields.
              14.      
              15.           In FMP13, hidden objects (”Hide object when”) will slide/resize.