--- alias: user-guide-create-printable-document tags: - printing integration description: "Create a printable document by defining its settings, data context, and printing options" --- # Create Printable Document :lock: PrintableDocument.**Create** ## Overview This operation is used to create a **Printable Document**. ## Setup No specific setup is required other than to meet the precondition of the transaction. ## Preconditions * The Printable Document name must be provided and must be unique. ## Sequence of Steps {% include-markdown 'includes/pages/info_creating_versioned_entities.md' %} ### Step 1: Change Set 1. Select an existing Change Set or if configured to support implicit Change Sets, it is also possible to select the option Use Automatic Change Set. 2. Select the Approval Role. ### Step 2: General Data 1. Enter the **Printable Document** name. 2. If you are creating a new version, the revision that was selected when you started the process will be the revision to which this version will be associated. If you are creating a new entity or revision (with a new version associated to it), provide a name for the revision or it will be automatically generated for you. For more information on revision naming, see [[revisions-index#naming|Revision Naming]]. 3. Enter the **Printable Document** description. 4. Select the **Printable Document** type. The list of possible values is taken from the [[printabledocumenttype-lt]] Lookup Table. 5. Select the Scope to be used for this **Printable Document**. !!! note The Lot Traveler scope carries a special meaning for the system. It means that the Printable Document is intended to be used as a Lot Traveler which works by dynamically assembling the different Step Printable Documents of the Material. Additionally, if the Scope is changed from any value other than `Lot Traveler` to `Lot Traveler`, there should not be any version for which the Layout Content Type is set to `External`. Weigh and Dispense Label scopes are to be used exclusively within the Weigh and Dispense Material operations. For more information, see [[user-guide-weigh-and-dispense-material]]. 6. Optionally, select an Entity Type to which the **Printable Document** applies to. Take the following into account: * If the Scope is Label, any Entity Type can be selected. * If the Scope is Lot Traveler, the **Material** Entity Type is pre-selected and cannot be changed. * If the Scope is Packing, the **Package** Entity Type is pre-selected and cannot be changed. * If the Scope is Weigh And Dispense Label, the **Material** Entity Type is pre-selected and cannot be changed. 7. Select the Layout Content Type: * Internal (default) * External (optionally provide External Layout information) !!! info For more information, see [[tutorials-printingrealusecaseinteractions#user-interactions|User Interactions]]. 8. Select whether the Print History is to be stored or not. !!! note The Print History is stored but you can only visualize it in the Reprint Material Documents page, [[user-guide-reprint-material-documents#step-1-documents|Step 1: Documents]], and only if you also enabled the Store Layout History property. 9. Select whether the Layout History should be stored together with the Print History. !!! note The Layout History is stored but you can only visualize it in the Reprint Material Documents page, [[user-guide-reprint-material-documents#step-2-printer|Step 2: Printer]], and only if you also enabled the Store Print History property. 10. Select the Printer Type. The list of possible values is taken from the [[printertype-lt]] Lookup Table. If the type is Lot Traveler, then the printer type General is pre-selected and cannot be changed. 11. Optionally, select a Default Printer. The list of available printers is defined in the [[printertypeprinterscontext-st]] Smart Table. ![Screenshot showing a list of available printers in a Smart Table.](images/create_printable_document_step_one.png) ### Step 3: Data Context This step is used to define the context that is supplied to the **Printable Document**. In case of Lot Traveler types, the context is pre-defined (although it only appears once the wizard is closed) and cannot be changed. 1. Specify as many data context items as necessary (using the toolbar :material-plus: and :material-trash-can: buttons to add and remove items) and for each of them, provide: * The data context name. * The data context description. * Select the data context item's type: * **Input** for items whose values are to be input by the user. * **Variable** for items whose values will be automatically calculated. * Select whether the data context represents a Serial Number or not. * Select the Value Data Type of the data context value. * Select the item Value Object Type, only in case the value data type is Object. * Select whether the item Value is a collection of values or a single value. !!! note Context items of type Input can only be used as collections for `PrintableDocuments` of type Weigh And Dispense Label. * Optionally, enter a Default Value, in case the Value Data Type is not Object. * Select the Source Type, which depends on the Type and Value Data Type and can be: * **Free** or **LookupValue** for items of Type Input and Value Data Type different from Object. * **Free** or **Query** for items of Type Input and Value Data Type equal to Object. * **Rule** or **Expression** for items of Type Variable and Value Data Type different from Object. * **Rule**, **Expression** or **Query** for items of Type Variable and Value Data Type equal to Object. * **NameGenerator** for items of Type Variable, Is Serial Value set to `true`, and Value Data Type set to String. * Select or enter the Source: * For LookupValue Source Types select a Lookup Table. * For Rule Source Types select a Rule. * For Query Source Types select a Query. * For NameGenerator Source Type select a Name Generator instance. * For Expression Source Types enter an expression in the form: * `$AppliesToValue[.Property][.Property]` - to access properties of the Object of Type Value Object Type. * `$DataContextItemName[.Property][.Property]` - to access properties of the Data Context item. * Some examples: * `$AppliesToValue.Facility.Name` - to access the Facility name if the Applies To Object is a Material. * `$AppliesToValue.Product` - to access the Product if the Applies To Object is a Material. * Define the input/calculation order by using the toolbar :material-arrow-up: and :material-arrow-down:. ![Screenshot showing a toolbar with up and down arrow icons for reordering input/calculation order.](images/create_printable_document_step_two.png) !!! info The order of the data context items is important, especially if one data item references another. The context items are evaluated in the order they are sequenced. The data context items will appear automatically in the Data Dictionary as possible data sources (objects) and variables (scalars) for the layout editor.