With Smart Document Templates, you can create custom PDFs using data from your records in Infoplus. For example, create documents to customize your warehouse workflows, or invoices for sending to your 3PL customers, or inserts to add to your outbound orders. Any value in a field in Infoplus can be used. You can also customize the data using Scripts, for even more custom control.  


Create a Smart Document Template

  1. Navigate to the Smart Document Template table.  
  2. Click the Create New button in the top right. The Creating New Smart Document Template screen appears:


  3. Enter a Name that describes what this template will display or other relevant information for you to identify the template (e.g., Order Insert Template).

  4. In the Page Width field, enter the width (in inches) of the page that you will be printing on (defaults to 8.5, for a standard letter page size).

  5. In the Page Height field, enter the height (in inches) of the page that you will be printing on (defaults to 11, for a standard letter page size).

  6. In the Record Type field, select the type of record that you will pull value(s) from (e.g., if you want to display data from an Order, select Order as the Record Type, if you want a document with Item details, select Item as the Record Type, etc.).

  7. In the API Version field, select the version of the Infoplus API that you want to use. This selection will drive what variable names you can use in the Code below.  You will typically select the last API used.

  8. For further customization, you may choose a Script, which you have previously created on your Infoplus site.  You can always come back and edit this record, to add a script at a later time.  

    Use the Code Editor

  9. In the Code Editor, type the text and field variables that you want to display in the template. Then format the content using the toolbar.
    NOTE: A variable is code that tells Infoplus where to get a value. To request a value from a field, start by typing $record. and then type the field name. For example, if you want to display the Order Number, you would type $record.orderNo. Field names are available in the Infoplus API Reference Site. Select the correct API version and table (that corresponds to the Record Type selected above) on the left.


    Note, the language used for Smart Document Templates in Infoplus is the Velocity Template Language.  Also note, for the highest degree of control while editing the Code for a template, you may wish to hit the Source Code button in the Code field's editor panel.  

  10. To insert a barcode, click the Insert/Edit Image button (6QmeRqwQdSoV_WIL7AhgQqN2fpFFgftWBw.png). This screen will appear:

    Ybha-zZeFGyszs3LIDmVOWzP1d1E_2e5jg.png

  11. In the Source field, type $barcodes. and then type the field name that you want represented by a barcode. For example, if you want the Order Number to display as a barcode, type $barcodes.orderNo
    • You can also generate a barcode from any value you wish, besides just fields on the record (such as a field from a different record type, a value generated by a script, or even a hard-coded string) by using code such as:  ${utils.generateBase64Barcode($myValue)} to render a barcode from the variable $myValue, or ${utils.generateBase64Barcode('1234-9876') to render a barcode from the string 1234-9876 (being sure to enclose the hard-coded string in single-quote characters, as shown here).
      • If the value is an integer, you will first need to convert it to a string using ($myValue.toString())
    • To generate a UPC-A barcode for any value you wish, use the following code:
      ${utils.generateBase64Barcode('UPCA','123456789012')}

  12. In the Dimensions fields, enter the width and height of the barcode image. These dimensions are typically no less than 100 pixels wide by 40 pixels high.

    Here's an example of the completed Insert/edit image screen for the Order Number label shown above:

    GDPfyI2IFfS6kvoJ-8r9j04Pcf3wNKXoZQ.png


  13. Click OK
  14. Apply any formatting to the content in the Code Editor as needed (e.g., to center all of the content, select the content and then click the GcRwrI1tmzY7EB7NKAo9Qr3t6b0PklM-Tg.png button).

  15. Once you are done creating the Smart Document Template, click Save. The template is saved and available for use.

Preview the Smart Document Template
You can preview a Smart Document Template any time, but we recommend previewing the template immediately after you create it to ensure it displays as desired. 
  1. From within the Smart Document Template record, select Actions > Preview Smart Document Template.  The Setup step in the process appears.
  2. Enter a Record ID to use for the preview. For example, if you are previewing a template showing an Order Number, enter an existing order number to use as the record in the preview.
  3. Click Next. The Review step in the process appears.
  4. Review the Results. If a green arrow displays, the preview will be generated.
  5. Click Submit. The final Results screen appears.
  6. To view the template, click Download Report. Another tab will open in the browser displaying the preview.

  7. Click back on the Infoplus browser tab and click OK to close the preview process. If you need to edit the template, open the template record and select Actions > Edit


Render a Smart Document  Report

A Smart Document Report will render documents using one or more selected records based on the Smart Document Template you select. 

  1. Access the Table containing the records you want to use in the Smart Document report (e.g., if you want to generate documents for Orders, access the Orders table).
  2. Click the checkbox next to each record that you want to use in the Smart Document report.
  3. Click the Actions button.
  4. Under the Reports sub-header, select Smart Document. The Setup step in running the report appears.
  5. Select the Smart Document Template you want to use.

  6. If you want more than one copy of the document for each record, enter the appropriate number into the Copies per Record field (e.g., if you wanted a label to appear inside a carton, outside the carton, and one for your paperwork, type a 3).

  7. Click Next. The Review step appears.  

  8. Review the Results for each record selected.

  9. Click Submit. The final Results screen appears.

  10. To view the report, click Download Report. Another tab will open in the browser displaying the report.

  11. Click back on the Infoplus browser tab and click OK to close the report process.  


Related Content: