4 Replies Latest reply on Feb 15, 2011 2:55 PM by DanielClark

    Trying to build a Print Layout that will organize my portal records in same as original layout

    DanielClark

      Title

      Trying to build a Print Layout that will organize my portal records in same as original layout

      Post

      I have a Purchase Order layout and I am trying to create a print layout. I have everything working just about perfectly except for the fact that the line items appear in a different order when I go to my print view than they appear in the portal on my original Purchase Order layout. I have a record number field in both places, but they're not identifying the line items from each layout by the same record number. How can I fix this? Thanks.

        • 1. Re: Trying to build a Print Layout that will organize my portal records in same as original layout
          philmodjunk

          Determine the sort order in your portal--this might be defined in Portal Setup... or it might be defined as part of the relationship on which this portal is based.

          Sort your records on the print layout in the same order. If you are using a script that performs a find to find the line item records, just add this sort step as the next thing done after the Perform Find step.

          Note: if you define the sort order in the relationship, it's possible to use Go To Related Records to pull up your line item recors on your report layout. In which case, the records pulled up by the Go To Related Records step will be in the order that matches the relationship level sort order.

          • 2. Re: Trying to build a Print Layout that will organize my portal records in same as original layout
            DanielClark

            I'm not sure what you mean - here is my script - what command and where to put the sort thing?

            Set Variable [$$CurrentLayout; Get(LayoutName)] - This is for the "Go Back" script that will return the user to the normal layout

            Commit Records/Requests [Skip data entry validation; No dialog]

            Allow User Abort [Off]

            Go to Related Record [Show only related records; From table: "PO Line Items"; Using layout: "POs-Print" (PO Line Items)]

            Perform Script["Get Pages Total"] - This script gets the total amount of pages there are an inserts it as a 'Page x of X" at the bottom of the page

            Print Setup [Restore]

            Enter Preview Mode []

            Pause/Resume Script [Indefinitely]

            If [Get(ScriptParameter) = "Print"]

            Print [Restore:Default Printer]

            End If

            Perform Script ["GoBack"]

            Enter Browse Mode []

            There's the script. Also as a side question - Can I get it to return to my original layout based on the user hitting cancel when presented with the print dialog box? Thanks again.

            • 3. Re: Trying to build a Print Layout that will organize my portal records in same as original layout
              philmodjunk

              What sort order is specified for your portal? Do you have a sort order specified in the portal setup?

              If no order is specified for the portal and no order is specified in the relationship you are using in your Go To Related Record step, then the order of records on your layout should match the order in the portal and no sorting should be needed. If there is a sort order specified, then you'll need to either make changes a sort order specified in the relationship so that the Go To Related Records step pulls up the records in the correct order or you can add a Sort[Restore] step just after your Go To Related Records step in the above script.

              To specify a sort order at the relationship level, open Manage | Database | Relationships, find the line linking your two tables that represents this relationship and double click it. You'll find a Sort Records check box where you can specify a sort order for the line items' table--this is the order Go To Related Records will use when it brings up your portal records.

              I think you can modify your script like this:

              Set Error Capture [on]
              Print [Restore:DefaultPrinter]