6 Replies Latest reply on Jun 29, 2013 9:14 AM by philmodjunk

    Help to make some sort of conditional print function.

    hanstrager

      Title

      Help to make some sort of conditional print function.

      Post

           I've made a small application to use for explaining how to Sew garments together.

           It consists of a BOM som condtional value lists etc. and then there's a print layout where everything is layed out and ready to print.

           Sometimes it's not enough to describe the sewing process in words and there needs to be pictures attached to make a seamstress fully understand what is mean. This is only necessary in about 10% of cases, but it's a quite valuable function.

           My problem is how do I/is it possible to add a page into my print layout, that only becomes a printable page the minute a picture is placed into a container..?

           Sometimes i need to print 4 pages instead of 3 but most often i have only to print 3 pages, and not 3 pages + 1 blank page..?

        • 1. Re: Help to make some sort of conditional print function.
          philmodjunk

               You might use  two layouts, one for BOM's with picture and one for BOM's that do not.

               You can also set a container field to slide up, resize enclosing part as long as you also select the container field (While in Layout Mode) and use the formatting on the data tab to specfiy top alignment instead of the default center alignment.

               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.
          • 2. Re: Help to make some sort of conditional print function.
            IT_User

                 I would agree with Phil, that one of those ways would work.

                 Another method, (probably unnecessary and more hassle than it is worth) if you don't need a summary at the bottom of the printout, then you could do 2 layouts.  One with the 3 normal pages and the other with the picture.  Then in the script it can decide whether to just print the 3 pages or print the 3 pages and then go to the layout with the picture and print that, as well.  That would allow the picture to be used for other other scripts and layouts.

                  

                 Thank you for putting BOM conditional value list.  Coincidentally, I looked at a different website to try and solve a problem.  I had no idea what it was, but I think I have a better idea now.

                 http://www.soliantconsulting.com/blog/2012/09/extending-filemaker-pro%E2%80%99s-value-list-sort-capabilities-using-char-function

                 https://en.wikipedia.org/wiki/Byte_order_mark

            • 3. Re: Help to make some sort of conditional print function.
              hanstrager

                   Not entirely sure how to make the sliding work. How do the page slide up in the print layout and not leave behind an empty space..? I guess i need to set the container to the maximum size of the content (this case A4), and then I have to add an extra page on the layout to make space for the container, but that extra page are never gonna go away if there's no content in the container..?

                   I could make 2 layouts but at the moment a huge time saver is the abillity to print multiply records at the same time. Is that not going to interfere if printing from 2 different layout simultaneously depending on whether a container i empty or not..?

              • 4. Re: Help to make some sort of conditional print function.
                IT_User

                     You need to start the container on the 3rd page. Then with sliding enabled, when it prints it will resize depending on if there is anything in the container.  If there is something in the container it will print it, and if there isn't then it will not print the extra page.

                http://www.filemaker.com/12help/html/create_layout.9.52.html

                                                                                 
                                    
                Close up the space in the layout part that contains the selected fields. To slide the part up relative to all objects, set this option for all the objects that are sliding up. To slide the part up relative to a single object, set this option for that object only.
                               
                                                    

                     Also, Phils 2 different layout method is different from what I said.

                     He said to put one layouts with 3 pages (the original stuff) and one with 4 pages (the original stuff and the object).  I said one layout with the 3 pages (the original stuff) and one with the object.  Just forget what I said, and we'll concentrate on Phil's solution.

                     For Phil's one solution, you would either print the one layout OR the other layout, not both.  So the script set to print will have an if to check if the container is empty and decide whether to print layout1 or layout2 (one with the container or one without).

                • 5. Re: Help to make some sort of conditional print function.
                  hanstrager

                       Thank you sliding works now - i forgot to turn on "Also resize enclosing part" which did the magic... thanks for bot you guy's help

                  • 6. Re: Help to make some sort of conditional print function.
                    philmodjunk

                         The container field does not have to be on the last page for this to work. But if you put objects below the container field, they also have to be set with the same slide/resize options as the container field as stated in item 3 of my original post.