Skip to main content

Creating an Excel Template

To create an Excel template, follow the next steps:

1. Open Microsoft Office Excel and create a new spreadsheet.

Give it the required format by changing the font, font size, cell formats, margins, formulas, etc., according to your design.

Document Templates 64

The format of your spreadsheet can include titles, subtitles, tables, images, formulas, etc. Additionally, you can include as many sheets as required.

For example, to create an Invoice template in Excel, we need the Customer's information and a table to show the Products purchased.

Document Templates 65

2. Reference the information that will be dynamically obtained from the Bizagi data model.

Remember that the information to be retrieved must be specified as Template Tags (e.g., [AttributeName]). This will allow obtaining the information from the data model of the Process.

For example, the Customer name is referenced with the [CustomerName] Template Tag.

Document Templates 66

To make reference to a collection, use the following tags:

  • [Foreach:CollectionName]: Indicates the starting point of the collection.
  • [AttributeName]: All attributes between the Foreach and the End tag must belong to the collection.
  • [End]: Indicates the end of the collection.

Document Templates 67

Note In the image above, the Products collection is referenced by using the [Foreach:Products] sentence. All the tags typed from this tag until the [End] tag are assumed to be attributes of this collection ([Product], [Quantity], [Price]).

Note:

  • The attribute and collection names can be different from the names given in the data model. These are only references for mapping the information.
  • Tags cannot contain spaces.
  • Every single tag for the columns of all collections MUST be unique. No two columns in a document can have the same tag name, even if they belong to different tables.

3. Include the required formulas.

Suppose that our Invoice needs the total price to be automatically calculated as the product of the quantity by the unit price for each row. A formula in the Total Price cell can be used for this purpose.

Document Templates 84

Note:
When generated, all formulas included in Excel templates will be recalculated.

4. Save your template.

Once you have defined the desired format and document body, save the book as a standard Excel Book (.xlsx).

Document Templates 68