7 Replies Latest reply on Jan 12, 2015 9:26 PM by philmodjunk

    Printing Multiple Found Sets

    MaxwellRobin

      Title

      Printing Multiple Found Sets

      Post

      Hi Guys,

      I am trying to create a script to print multiple found sets based on a field.

      This is set up exactly like a computer printing specific pages ( page 1 to 5, and it prints page 1, 2, 3, 4, 5 or page 2 to 2, and it prints page 2)

      I have two fields set up with drop down menus. Their value list gets the page values from a different table.

      I would like the user to input into the two fields the pages they would like to print. Then hit a button to run this script.

      Print the selected pages to one pdf document.

      What the script is actually doing is performing a find for the values in the two fields i created above. So if the user puts in a value of "1" in the first field, and a value of "4" in the second field. Then click a "print" button. The script will run and create a PDF of the found set with the print value field of "1". Then do it again with a value of "2". Then a value of "3". Then "4". Then bundle these separate PDFs into one PDF, which can then be saved.

      Is this possible?

      Any help would be appreciated.

      Thank you.

      Maxwell

        • 1. Re: Printing Multiple Found Sets
          philmodjunk

          Most options in this area refer to Records, not Pages. A single printed page could show data from part of one record or data from many records. What does the 1, 2, 3, 4 represent in terms of your records?

          Off hand, I don't see then need to have four different saves in order to generate 4 different pages of a PDF. A find for values 1..4 could result in a PDF of the same data with the same page breaks.

          • 2. Re: Printing Multiple Found Sets
            MaxwellRobin

            So I am creating shipping labels for palettes of product. the numbers are Palette IDs. I need to print a PDF of each Palette ID separately, but have all of the palettes in the total shipment bundled as one PDF document. 

            • 3. Re: Printing Multiple Found Sets
              philmodjunk

              So I am creating shipping labels for palettes of product. the numbers are Palette IDs.

              Then from what you have posted, I must assume that you have one record for each palette corresponding to one label to be printed...

              If you perform a find for all the Palette records for a single shipment, you can then use Save As PDF with the "records being browsed" option specified to generate a PDF of those palette records all in one step. If necessary, you can enter layout mode on this layout, double click the body layout part to open the part definition dialog and specify a page break after every [1] occurrence.

              • 4. Re: Printing Multiple Found Sets
                MaxwellRobin

                Well... I actually have one record for each product. Multiple products go onto a palette. and multiple palettes go into a shipment. each record has a Palette ID field. So when I find records with the palette ID of "001" and print to PDF, it works great. but I would like to be able to find multiple palette IDs and print them all in one PDF with page breaks between each palette.

                • 5. Re: Printing Multiple Found Sets
                  philmodjunk

                  And what prevents you from doing so? Where does this break down for you?

                  Whether a manual find or a scripted find the process is simply a matter of generating multiple find requests--each with a different palette ID specified and then you perform a single find. (There are also ways to use Extend Found Set to get the same result.)

                  And if you don't have a record for each palette linked to the products to be shipped on it, I would recommend that you consider setting that up as it could be useful for a number of typical database operations--not just the printing of labels.

                  • 6. Re: Printing Multiple Found Sets
                    MaxwellRobin

                    You are correct. So I got it to work great. Here is what I can't get to work.

                    I have a field [Items List::Print Packing List First], which is what I would like the user to use to enter the first Palette ID they would like to print.

                    I have a field [Items List::Print Packing List Last], which is what I would like the user to use to enter the last Palette ID they would like to print.

                    These two numbers they put in these fields are the range of Palette IDs they want to print.

                    Once the user inputs numbers into these fields they cluck a button that runs a script.

                    This script performs a find to omit records < [Items List::Print Packing List First] as well as records > [Items List::Print Packing List First].

                    Im not sure how I am supposed to allow the two records described above to determine the criteria for the find.

                    Thank you

                    • 7. Re: Printing Multiple Found Sets
                      philmodjunk

                      Omitting records makes no sense to me when I read this. Here's how I would set this up--with a single find request that specifies a range of values from Print Packing List First to Print Packing List Last:

                      First: These two fields must have global storage specified in order for the following scrpt to work:

                      Enter Find Mode [] --no criteria specified here, clear the check pause check box
                      Set Field [YourTable::PalletteID ; Items List::Print Packing List First & "..." & Items List::Print Packing List Last ]
                      Set Error Capture [on]
                      Perform Find [] ---> again, no criteria specified here

                      You'll need to specify the correct table here, the one that holds the data for your labels and perform this on a layout based on the same table.

                      This is based on one of the many scripted find examples found here: Scripted Find Examples