Print Templates

From LongJump Support Wiki
Revision as of 22:07, 18 May 2011 by imported>Aeric
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Designer > Data & Presentation > Objects > {object} > Print Templates

Print templates are powerful tools, allowing you to set up documents that pull information from a specific object, like a mail merge. Print templates are loaded into the platform and can be used to set up standard proposals, queries, contracts, invoices, etc., and generate PDF documents unique to specific records - any document that you can dream up.

Examples

  • Create an Expense Report to be used in expense management application
  • Print an Employee Benefit Form
Print templates are created outside of the platform, using an HTML editor

How it Works

The Print Templates feature lets you generate graphical mail-merge-style PDF documents using variables and HTML. You can use these templates to create prefilled forms, invoices, contracts, and other types of documents using data stored in your application. The platform uses the Apache Velocity templating engine to create powerful dynamic documents. See http://velocity.apache.org for more information.

  • Before you add a print template, you first create an HTML document that includes all of the text, images, logic, etc. that you want to include in your template.
  • While creating this document, you should make note of the fields you will later add to the document. Use the Template Variables lookup section to find the field names that will allow you to customize the HTML file. See HTML Resources for more information.

Some features to consider when building print templates:

  • CSS styles can be embedded into the HTML file, giving you a high degree of control of the final output of the file.
  • Images can be placed into your document server and accessed by the template via Web access.
  • Using the Velocity scripting language, you can build logic directly into the template to change the content based on specific customer parameters.


Add a Print Template

A Print Template can be added to any object, except for the built-in Documents and Users objects. It can use a Page stored in the platform, or it can be created using an external HTML, Word, or PowerPoint file. This section outlines the process.

To add a Print Template to an Object:

  1. Click Designer > Objects > {object} > Print Templates
  2. Click the [New Template] button.
    The New Template page appears.
  3. Use the Template Variable Tool to get the names of variables you can use in the template:
    TemplateVariableTool.jpg
    Note:
    Template variables can be used in HTML, Word, and PowerPoint files. (In Pages stored in the platform, you use standard JSP programming techniques to access platform information, rather than template variables.)
  4. If it does not already exist, create the template:
  5. Provide the information in the Template Information section:
    Template Title
    The template name
    Description
    Describe the purpose of the template or other information about it.
    Ready to Use
    The default setting for the template is Yes.
    Type
    HTML - To upload an HTML, Word, or PowerPoint file stored on your local system.
    • The [Browse] button appears.
    • Click it to locate the file to upload.
    Page - To use a JSP/HTML Page stored in the platform.
    • A list of platform Pages is displayed.
    (The list does not include pages that have the Include Headers option.)
    • Choose one of the listed pages.
  6. Click [Save]

Use the Template

  1. To use the template, open a record in the object. A set of buttons will be displayed with the record.
    File:Printbutton.gif
  2. Click the [Print] button to print the record using the Print Template

See Also

Sample print templates are available for use and customization.