8 Replies Latest reply on Feb 6, 2017 9:27 AM by philmodjunk

    Print/email found set from new window

    JeffJ

      I have found that opening a new window shows an unsorted and unconstrained view of a given table even if the previous window that viewed the same table has a sort order and a found set. I would like script a function to freeze the original window, open a new window with a different layout, then view/copy the found set and sort order from the original window to the new one. I would then print or email the found set from the new window, with the original window in the background, and finally close the new window returning to the original without any changes. I have accomplished all of this accept duplicating the found set and sort order of the original window to the new window. Any ideas anyone? Thanks

        • 1. Re: Print/email found set from new window
          philmodjunk

          This is not what I see when I do this. Whether I manually create a new window from the windows menu or run a script with the new window command, the layout, found set, current record and sort order is initially identical in both windows.

           

          Perhaps opening the new window is tripping a script trigger that then does a show all records in your new window?

           

          And how does the "different layout" come into play here? If the other layout is based on exactly the same table occurrence, It will also have the same found set, current record and sort order. If it is based on a different table occurrence, it will not, even if the different table occurrence has the same data source table as the table occurrence specified for the first layout.

          FoundSetInNewWindow.png

          • 2. Re: Print/email found set from new window
            JackRodges

            Like philmodjunk says, a layout trigger might be the culprit.

             

            Unfortunately when you create a new report layout and FIleMaekr asks if you want to create a script, it inserts as a on layout open trigger to find all and sort.

             

            Check your layout triggers...

             

            The question is why do you want to open a new window. Your script can go to many layouts and then end up returnting to the original layout.

             

            Script:

            go to a different layout

            do stuff

            go to layout original layout

            • 3. Re: Print/email found set from new window
              philmodjunk

              The question is why do you want to open a new window. Your script can go to many layouts and then end up returnting to the original layout.

               

              In some cases, it's a good idea as using the new window reduces the number of possible script trigger trips and leaves the current layout objects (tab control panels, portal scroll positions, etc.) exactly the way they were at the time the script is performed.

               

              On the other hand, if you are on Windows and have designed the UI to work with maximized windows, the results of opening that extra window get a bit ugly.

              • 4. Re: Print/email found set from new window
                JackRodges

                Ah, inspiration.

                 

                I am going to add a text object based on the platform for my splash screen:

                 

                Hi, I'm Windows and I'm Ugly.

                Hi, I'm Macintosh and I am totally absorbed in myself.

                Hi, I'm Go and a bit disconnected from reality.

                 

                 

                • 5. Re: Print/email found set from new window
                  JeffJ

                  Yes, all that you said about keeping a familiar look on the screen, as much as Windows can do, while an "output" layout is used in a minimized but active window. As for the found set and sort issue; I forgot to mention I am working with FM 11 and even after following the entire process with the debug tool I end up with a new window that shows all records unsorted without script triggers causing it. Is there a way to record the find and sort info from the original window and impose it on the new window? Thanks

                  • 6. Re: Print/email found set from new window
                    philmodjunk

                    Yes, but WHERE do you see that different found set? Immediately after you create the new window or after you change to a different layout in that new window?

                     

                    What we are saying about new window still having the same found set only applies to any layouts in the new window that are based on the same table occurrence (box in the relationship graph) as that of the current layout in the original window. This is the same in FileMaker 11 as well as current versions. (but PLEASE tell people that you are using v11--it can save people a lot of effort suggesting a fix that doesn't work in an older version.)

                     

                    Within a given window, each table occurrence has it's own found set, current record and sort order. Switch to a different layout, even if it has the same data source table, that is based on a different table occurrence and you get a different found set, etc. When you first open a new window those found sets are replicated, but then any action that changes a found set in the new window, does not affect the found sets in the original window.

                    • 7. Re: Print/email found set from new window
                      JeffJ

                      You are correct, of course. Opening a new window "imitates" all aspects of the original. What you pointed out was that I was then switching to a different layout "connected" to a related table. Even though the header and footer of this print only layout contained only information from the main table, the body was "connected" to a detail line items table so it reset to a show all view. The solution was to "connect" the print only layout to the main table and show a portal of the related line items in the body. This way the minimized window with the print only layout starts with the same found set and sort order as the main window that mostly stays in place during the print operation. Thanks for helping to sort that out.

                      • 8. Re: Print/email found set from new window
                        philmodjunk

                        Sorry, but that seems the wrong way to go.

                         

                        Use Go to related records or a Find to find the line items records on the line items table and print from there. You an be much better print results from a list view layout based on the line items that using a portal for printing.