3 Replies Latest reply on Oct 18, 2011 3:19 PM by philmodjunk

    I need a script to print selected layouts per record

    ederecat

      Title

      I need a script to print selected layouts per record

      Post

      I currently have a database with 10 different layouts per record.  From the main menu I have a list of all ten layouts with a yes/no radio button next to each to select which layouts I want to print for that specific record.  I believe it is a if(),then() type script, but I have yet to figure out the scripting.  I hope someone can help me with this.

      Thanks

       

        • 1. Re: I need a script to print selected layouts per record
          philmodjunk

          This sounds like a very unusual design. Please describe what you are doing and why in more detail. That way we won't help you right into more trouble and won't waste time making suggestions that won't work for you.

          • 2. Re: I need a script to print selected layouts per record
            ederecat

            Thanks Phil

            Attached is a jpg of the main page with the print que and also the drop down of the layouts to show the comparison to the list.  This is a techinical package we make for garments we are sending offshore.  The different layouts hold different amounts of information.  We never use all the layouts in one record so I would like to pick and choose which ones I will print of export as a pdf to send to the factory.  I want to be able to select yes for the pages I want to print and then press the "print pages" button to print the specific layouts. Hope that is a better explaination.

            Thanks

            • 3. Re: I need a script to print selected layouts per record
              philmodjunk

              What I don't see on this layout is any method for selecting the specific record. I can only assume that you have selected the record before using this layout to specify layouts and generate the PDF. I am also assuming that each layout is based on the same table occurrence so that they all have the same record or set of records in common. If this is not the case, the script below will need additional steps.

              A script with this structure (I'm not spelling out all the details here) should work for you if you use the "Append" option for the Save as PDF script step so that you can merge the output from all selected layouts into a single file.

              Use your table and field names in place of mine.

              Set Variable [$FilePath ; "File: " & //put expression here to specify location of PDF and name of the file]
              IF [YourTable::PrintQue1 = "Yes"]
                 Go TO layout ["Garment Specification Sheet 1"]
                 Save Records as PDF [Restore; Append; no dialog ; "$FilePath" ; //specify the other options you need for your script here]
              End IF
              If [YourTable::PrintQue2 = "yes"]
                 Go TO layout ["Trim and Findings Specification Sheet 2"]
                 Save Records as PDF [Restore; Append; no dialog ; "$FilePath" ; //specify the other options you need for your script here]
              End If

              # Now continue this pattern for each layout and associated radio button field.