Skip to main content

Forms

You can define a set of forms to help users in filling informations and producing well designed documents. A form is always associated to a Template and defines a rendering layout. The user provides the values for the template's fields and LogicalDOC renders the document as PDF file by applying the given layout.

Creating a new Form

To add a new form, click on Add form and you will only have to give a name and assign one of the existing templates.

Editing the layout

Once created the form, select the item and right-click on it, here choose the Edit option.

The layout editor basically allows you to design the form in HTML format. You can use variables to reference the template's properties, just write the name of the field you want to be printed with the dollar prefix, eg.: $Buyer, $Seller

Variables available in the layout

  • document: reference to the document's data representation
  • ext. attribute name: extended attributes of the template can be referenced by the name itself with the dollar sign as prefix, eg: $Buyer, $Seller

How to format numbers and dates

You can use a couple of utilities to format numeric or date variables

  • to format a date: ${DateTool.format('dd/MM/yyyy', $DateToFormat)}     DateToFormat is the variable to format; dd/MM/yyyy stands for day/month/year
  • to format a number: ${NumberTool.format('#,###.00', $TotalToFormat)}     TotalToFormat is the variable to format;  # =  Digit, zero shows as absent; 0 = Digit; , = Grouping separator; . = Decimal separator