Difference between revisions of "Document Templates"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 68: Line 68:
1. Finding them in the [[Template Variable Tool]]
1. Finding them in the [[Template Variable Tool]]


2. Processing them in a loop


===Special Considerations for Grid Sections===
===Special Considerations for Grid Sections===

Revision as of 20:03, 19 August 2011

Designer > Presentation > Print Templates Print templates let you generate PDF documents for selected records.

About Print Templates

Print templates are powerful tools, allowing you to set up documents that pull information from a specific object and merge into an HTML or JSP page. 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

Notepad.png

Note: HTML print templates are created outside of the platform, using an HTML editor. The initial version of a JSP Page is created inside the platform. Once created, print templates can be downloaded, edited, and uploaded again.

Learn more: Sample Print Templates you can customize and use.

How Print Templates Work

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.

Learn more: http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
  • Before you add a print template, you first create an HTML document (on your local file system) or an HTML/JSP Page in the platform that includes all of the text, images, logic, etc. that you want to include in your template.
    Learn more: HTML Resources
  • While creating this document, you should make note of the fields you want to add.
  • Use the Template Variable Tool to get the field names you need to customize the HTML file.

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 data parameters.

Working with Print Templates

Add a Print Template

Add a Print Template

Edit a Print Template

For a Print Template based on a JSP Page:

  1. Click Designer > Logic > Pages > {page}
  2. Edit the page.
Learn more: Pages

For a Print Template based on an HTML page:

  1. Click Designer > Data > Objects > {object} > Print Templates
  2. Click the Download link on the template you want to copy to your local system.
  3. Make changes to the template.
  4. If you need the names of additional variables, click the [New Template] button to access the Template Variable Tool:
    TemplateVariableTool.jpg
  5. If the New Template window is open, click [Cancel] to close it and go back to the Templates (record list) view.
  6. Click the Replace link on the template to upload the modified template.

Warn.png

Warning: Be sure to click the right link. The existing template page will be replaced by the new one.

Use a Template

  1. Open an object record.
  2. Click the [Print] button.
  3. Select Template based to create an HTML page using the Print Template.
  4. Select the Template
  5. Optionally, Select PDF format to get the results in PDF format. (Default is HTML.)
  6. Click [Print].
    A new window opens to display the results.
  7. Copy content from the resulting HTML page, print it, or save the page to your local system.

Accessing Related Records in Print Templates

Records in a Related Object have a Lookup to a record in the current object. (In an object Form, such related records are often displayed in a Grid Section.)

When formatting a record in the current object for printing, those related records and the fields they contain can be processed in a loop.

Finding and Using Related Record Variables

1. Finding them in the Template Variable Tool

2. Processing them in a loop

Special Considerations for Grid Sections

Finding totals and additional computation fields in the Template Variable Tool [[Category:Template:Features]]