13 Replies Latest reply on May 8, 2012 10:44 PM by JustinWhite

    Sorting quadrants for collated printing

    JustinWhite

      Title

      Sorting quadrants for collated printing

      Post

      Hello Gurus,

       

      I use FM to create name cards for people.  They are formatted to have 4 "index cards" per page however when I print them I sort them in an order, within excel, so that when they are printed I do not have to resort the cards into alpha order.  For example, if I have 16 names I take the first 4 names and assign them a 1, 5, 9, 13, the next 4 2, 6, 10, 14 and so on.  I then sort that column in ascending order so that when they are printed I only have to stack the 4 groups together instead of having to touch each card to put in order.  This doesn't matter for 16 names but when I have 1500 that can take a long time. 

      Is there any way in FM that I could create a calculation field named 'Print Order' that would automatically assign these numbers based off of the total number of people that i've imported?

      Any guidance would be awesome.  It doesn't take that long in excel to do this sorting however I think FM could probably do this.  My goal is to import the data I am sent right away into FM and let FM do the formatting upfront instead of me doing it in excel then importing into FM.  I have FM 9 btw.

       

      Thanks again,

       

      JW

        • 1. Re: Sorting quadrants for collated printing
          Sorbsbuster

          Try this (you can see also where you could change the number of cards per sheet.):

          • Enter Browse Mode
          • Go to Record/Request/Page [ First ]
          • #
          • Set Variable [ $CardsPerPage; Value:4 ]
          • #
          • #
          • Set Variable [ $PageNumber; Value:0 ]
          • Set Variable [ $Count; Value:0 ]
          • #
          • Loop
          • Set Variable [ $PageNumber; Value:$PageNumber + 1 ]
          • #
          • Loop
          • Set Field [ PrintOrder::PrintOrder; $PageNumber + ( $Count * 4 ) ]
          • Set Variable [ $Count; Value:$Count + 1 ]
          • Exit Loop If [ $Count ≥ $CardsPerPage ]
          • Go to Record/Request/Page [ Next; Exit after last ]
          • End Loop
          • #
          • Set Variable [ $Count; Value:0 ]
          • #
          • Go to Record/Request/Page [ Next; Exit after last ]
          • End Loop
          • #
          • Go to Record/Request/Page [ First ]
          • #
          • 2. Re: Sorting quadrants for collated printing
            JustinWhite

            Thank you for taking the time to address my questions.

             

            I am really new to FM 9 but I think im making good strides.  I have never made a script before but I think was able to match what you did above in a script.  The only thing is the # symbol which I think it just a separator??  However when I run the script it assigns numbers into the "print order" field but it is the same 4 numbers, 0, 4, 8, 12 for the entire set of 233 records.  

             

            What am I missing.

             

            Thanks a ton!

             

            JW

            • 3. Re: Sorting quadrants for collated printing
              Sorbsbuster

              The # is just a separator, though I should have used it to add some explanatory text.  Sorry.  Was in a hurry.

              I tested this before I posted, so it works.  Can you post up a screen shot of your script steps?  One place you could have made a mistake is in the excat position of the Loop and End Loop steps.  It sounds like the inner loop is working, but the outer loop is the one that moves them on to the next page.

              The early bit should be this:

              • Set Variable [ $PageNumber; Value:0 ]
              • Set Variable [ $Count; Value:0 ]
              • #
              • Loop
              • Set Variable [ $PageNumber; Value:$PageNumber + 1 ]

               

              I think you may have this:

              • Loop
              • Set Variable [ $PageNumber; Value:0 ]
              • Set Variable [ $Count; Value:0 ]
              • #
              • Set Variable [ $PageNumber; Value:$PageNumber + 1 ]
              • 4. Re: Sorting quadrants for collated printing
                JustinWhite

                Sorbsbuster,

                 

                Thank you for your time one this.

                Here is a screen shot of the script on my end.  I believe it matches what you have posted.

                Thanks again,

                 

                JW

                 

                • 5. Re: Sorting quadrants for collated printing
                  JustinWhite

                  Sorbsbuster,

                   

                  I've got it.  I did have a small type.  The first step after the second loop I was referencing $PrintOrder inseat of $CardsPerPage.

                  You have really eliminated a time consuming process for me.

                  I greatly appreciate it!!

                   

                  Thanks a ton!

                   

                  JW

                  • 6. Re: Sorting quadrants for collated printing
                    JustinWhite

                    Sorbsbuster,

                     

                    Actually we are close.  I thought it looked good but as I go through the records the numbers are still not right.  If I have 60 names that means the first 15 names need start with 1 then increase by 4 all the way to 60 but not going past.  Then the 16th name will be 2 and increase by 4 all the way to 60 but not going past, the 31st name starting with 3 and increasing by 4 and the 46th name starting with 4 and increasing by 4

                     

                    The assigned numbers after the script is run go 1, 5, 9, 13 and then starting with 2 and being 2, 6, 10, 14.  So after the first cycle the print order starts to repeat.  It should be assigning 1, 5, 9...all the way to 57 before starting with 2 and increasing by 4.

                     

                    Sorry if I am not explaining this correctly and thank you for your time.

                     

                    Best,

                     

                    • 7. Re: Sorting quadrants for collated printing
                      Sorbsbuster

                      Almost there, I think.  Either that or my head's about to explode.

                      • 8. Re: Sorting quadrants for collated printing
                        Sorbsbuster

                        Try this:

                        http://www.4shared.com/file/6VawNKY0/MultipleRecordsPerCard.html

                        You can sort by name, and it will show you the correctly calculated Card Number and Position Number (live).

                        If you run the script (the only one there) it will sort the names, and then capture the correct sequence, and then sort it in the correct sequence.  Note that as soon as you re-sort the dynamic sequence will look wrong as it will recalculate the values for the new sort order.  I only left the fileds there for you to see how they work

                        You can change how many records are printed per card.  It will show you how many cards you need.  You can find a sub-set and it will adjust.

                        Sold as-seen, no guarantees.

                        • 9. Re: Sorting quadrants for collated printing
                          JustinWhite

                          Sorbsbuster,

                          I really appreciate you helping me with this.  However since I am new to this the last reply was a little out of my expertise :(

                           

                          I have included a snapshot of the layout that I am trying to assign Print Order to.

                           

                          Is there anything I could do with this since I will always be importing large data sets but sorting them to unique variables.

                           

                          Thanks again.

                          • 10. Re: Sorting quadrants for collated printing
                            Sorbsbuster

                            Does it do what you expect it to do?  If you type in 20 names and set it to 4 records per card (at the top of the screen), and choose Scripts -> Trap the sequence, does it sort them the way you want?

                            It should show you which names would be on card 1, 2, etc, in Position 1, 2, etc.

                            If that is the case you could create copies of the fields into your file.  There are 6 fields plus the 'Name'.

                            If you check out the script you'll see how it sorts by the name alphanumerically.  That makes the Card and Position calculate correctly.  Then it sets ('traps') the correct card and position into two 'static' number fields.  Then it sorts by those fields, so it looks out-of-sequence alphanumerically, but should stack correctly when printed.

                            You can copy the script into your own file.

                            • 11. Re: Sorting quadrants for collated printing
                              JustinWhite

                              Sorbsbuster,

                               

                              I didn't realize I changed the name value to test with it.  I do not have recrods look like you had it with the list of them and the different columns.  I have included a screenshot of the layout that I need to have them sorted in print order.  How do I apply what you made into the layout template that I have included.

                               

                              Thanks,

                               

                              JW

                              • 12. Re: Sorting quadrants for collated printing
                                Sorbsbuster

                                The way they are sorted is all that matters.  If you sort them the way you want in the list, then change to the print layout in the screen shot, then they will print in the correct sequence.

                                You don't need to have any of the fields on the layout for the calculations and script to work.  I left them there so you could check it was working.  BTW: are you trying to sort them by name or by seat and row?  Not that it matters - just change the example I gave - I assumed your 'real' sort was by name.  It can be any sequence you like.

                                - Find all the records you want to print
                                - Use the first script step to sort them by the fields you want them collated by.  This triggers the sequence number calculation.
                                - the next steps in the script capture the modified sequence
                                - then they are resorted by the new sequence
                                -you could then go to the print layout and check the preview

                                • 13. Re: Sorting quadrants for collated printing
                                  JustinWhite

                                  Sorbsbuster,

                                   

                                  I figured it out!! I made the below formula as the calculation for the Print Order Field

                                  If ( Record Count Group ≥ Sequence;1+(Sequence-1)*4;If ( Sequence  ≤ Record Group Top Right ; 2+(Sequence-Record Count Group-1)*4 ;If (Sequence ≤  Record Group Bottom Left;3+(Sequence-Record Group Top Right-1)*4;If ( Sequence ≤ Record Count ;4+(Sequence-Record Group Bottom Left-1)*4 ; "" ))))

                                  Thanks for all your time.