---
title: Report Templates
slug: reports/report-templates
description: Use Unaric Reports report templates to control the visual output of data tables.
image: https://archbee-image-uploads.s3.amazonaws.com/10Nod6Ww95R3dPr0k0TCJ/7yyMJ2Z70YoJto-KSdjkV_captura-de-pantalla-20260223-155619.png
docTags: 
createdAt: 2026-02-12T03:09:49.963Z
---

To format report data within a Report Template, you must add a table definition to your document. Within that table definition, you'll add special tokens to indicate the type of table, the type of rows, and the placement for the data values. All tokens should be surrounded by curly brackets: \{\{ }}. Report Templates can contain any other standard components that you can normally add to a Word or Excel file such as a header, footer, page numbers, etc.

## Table types

The first token that is required is the table type token. Unaric Reports currently supports two types of tables: Type 1 and Type 2. To mark a table as a Type 1, you would include the &#x7B;&#x7B;TYPE1}} token for Classic and &#x7B;&#x7B;LIGHTNING\_TYPE1}} for Lightning in the first row. To mark a table as a Type 2, you would include the &#x7B;&#x7B;TYPE2}} token for Classic and &#x7B;&#x7B;LIGHTNING\_TYPE2}} for Lightning in the first row.

### Type 1

Type 1 tables are the simpler of the two types because they consist of just one column. This single column is used to specify the format for each type of row and location of data values. This means that templates that contain a Type 1 table definition can be used across multiple reports. However, they don't allow you to fully control the table output; for example, you can't do things like setting a specific width for each column.

### Type 2

With Type 2 tables, you include a column for every column in the report. This takes a little more work to set up and it ties the template to a single report (really to a single set of report columns). However, it gives you full control over the table, enabling you to perform many advanced tasks such as setting an exact width and alignment for each column, applying custom formatting to specific columns, etc.

## Template examples

### Word (DOCX) examples

::::Tabs
:::Tab{title="Lightning"}
[Lightning Table Type 1 - Minimum](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%201%20-%20Minimum.docx)
[Lightning Table Type 1 - Full](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%201%20-%20Full.docx)
[Lightning Table Type 2 - Minimum](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Minimum.docx)
[Lightning Table Type 2 - Full](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Full.docx)
[Lightning Table Type 2 - Field Values](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Field%20Values.docx)
:::

:::Tab{title="Classic"}
[Table Type 1 - Minimum](https://reportbuilder.cloud4j.com/Table%20Type%201%20-%20Minimum.docx)
[Table Type 1 - Full](https://reportbuilder.cloud4j.com/Table%20Type%201%20-%20Full.docx)
[Table Type 2 - Minimum](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Minimum.docx)
[Table Type 2 - Full](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Full.docx)
[Table Type 2 - Full (All Variables)](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Full%20\(All%20Variables\).docx)
[Table Type 2 - Field Values](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Field%20Values.docx)
:::
::::

### Excel (XLSX) examples

::::Tabs
:::Tab{title="Lightning"}
[Lightning Table Type 1 - Minimum](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%201%20-%20Minimum%20-%20Excel.xlsx)
[Lightning Table Type 1 - Full](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%201%20-%20Full.xlsx)
[Lightning Table Type 2 - Minimum](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Minimum%20-%20Excel.xlsx)
[Lightning Table Type 2 - Full](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Full.xlsx)
[Lightning Table Type 2 - Field Values](https://reportbuilder.cloud4j.com/Lightning%20Table%20Type%202%20-%20Field%20Values.xlsx)
:::

:::Tab{title="Classic"}
[Table Type 1 - Minimum - Excel](https://reportbuilder.cloud4j.com/Table%20Type%201%20-%20Minimum%20-%20Excel.xlsx)
[Table Type 1 - Full - Excel (Chart)](https://reportbuilder.cloud4j.com/Table%20Type%201%20-%20Full%20-%20Excel%20\(Chart\).xlsx)
[Table Type 2 - Minimum - Excel](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Minimum%20-%20Excel.xlsx)
[Table Type 2 - Full - Excel (Chart)](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Full%20-%20Excel%20\(Chart\).xlsx)
[Table Type 2 - Field Values](https://reportbuilder.cloud4j.com/Table%20Type%202%20-%20Field%20Values.xlsx)
:::
::::

## Available tokens

:::ExpandableHeading
### Row types

Row Type tokens are used to indicate the type of row.

| **Row Type Token**              | **Description**                                                                                                                                                                                              |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `{{HEADER_ROW}}`                | The header row contains the column headers.                                                                                                                                                                  |
| `{{GROUPING1_ROW}}`             | Contains the 1st level grouping value, for example, Type: ABC (10 Records).                                                                                                                                  |
| `{{GROUPING1_VALUE}}`           | Contains the 1st level grouping value (Lightning Only), for example, ABC (10).                                                                                                                               |
| `{{GROUPING1_VALUE_ONLY}}`      | Contains the 1st level grouping value only (Lightning Only), for example, ABC.                                                                                                                               |
| `{{GROUPING1_AGGREGATE_ROW}}`   | Contains the 1st level numeric aggregate information, for example, avg $100,000.                                                                                                                             |
| `{{GROUPING2_ROW}}`             | Contains the 2nd level grouping value, for example, Type: ABC (20 Records).                                                                                                                                  |
| `{{GROUPING2_VALUE}}`           | Contains the 2nd level grouping value (Lightning Only), for example, ABC (20).                                                                                                                               |
| `{{GROUPING2_VALUE_ONLY}}`      | Contains the 2nd level grouping value only (Lightning Only), for example, ABC.                                                                                                                               |
| `{{GROUPING2_AGGREGATE_ROW}}`   | Contains the 2nd level numeric aggregate information, for example, avg $200,000.                                                                                                                             |
| `{{GROUPING3_ROW}}`             | Contains the 3rd level grouping value, for example, Type: ABC (30 Records).                                                                                                                                  |
| `{{GROUPING3_VALUE}}`           | Contains the 3rd level grouping value (Lightning Only), for example, ABC (30).                                                                                                                               |
| `{{GROUPING3_VALUE_ONLY}}`      | Contains the 3rd level grouping value only (Lightning Only), for example, ABC.                                                                                                                               |
| `{{GROUPING3_AGGREGATE_ROW}}`   | Contains the 3rd level numeric aggregate information, for example, avg $300,000.                                                                                                                             |
| `{{DATA_ROW}}`                  | Main data values from the report.                                                                                                                                                                            |
| `{{ALTERNATING_DATA_ROW}}`      | The alternating data row also contains the main data values but represents the odd-numbered rows. This row is not required but if included allows you to use an alternating style for the odd-numbered rows. |
| `{{GRAND_TOTAL_ROW}}`           | The grand total row contains the textual grand total information, e.g., Grand Totals (100 Records).                                                                                                          |
| `{{GRAND_TOTAL_AGGREGATE_ROW}}` | The grand total aggregate row contains the grand total numeric aggregate information, e.g., avg $1,000,000.                                                                                                  |


:::

:::ExpandableHeading
### Standard data variables

Standard Data Variable tokens are used to place data values into the report. Note that row type tokens are used to specify a type of table or row and will be removed entirely when Unaric Reports produces the final output. Data variables, on the other hand, are not removed but replaced with the data.

| **Variable Token**               | **Description**                                                                                                                                                                                                                                                                                                                                                            |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{VALUE}}`                      | The value token is a generic token that represents the data value each cell. Everywhere you need a data value, you would include this token. As you can see in the examples, it's included in just about every row except for the column headers on the Type 2 table type.                                                                                                 |
| `{{UNFORMATTED_VALUE}}`          | The unformatted value token is similar to the VALUE token expect that it is used to bring in the unformatted value.                                                                                                                                                                                                                                                        |
| `{{FIELD_VALUE.FIELD_API_NAME}}` | The field value token gives you more control on where to place your data within the template - for example, if you wanted to have a formula column between two report columns. To use a named value token, prefix it with FIELD\_VALUE. and then add the API name. For example, if the API name was Account.Id, your token would be &#x7B;&#x7B;FIELD\_VALUE.Account.Id}}. |
| `{{USER_NAME}}`                  | Name of the Running User                                                                                                                                                                                                                                                                                                                                                   |
| `{{REPORT_NAME}}`                | Report name                                                                                                                                                                                                                                                                                                                                                                |
| `{{REPORT_CHART}}`               | Report chart                                                                                                                                                                                                                                                                                                                                                               |


:::

:::ExpandableHeading
### Advanced data variables

Advanced Data Variable tokens provides even more control of the data values. The &#x7B;&#x7B;VALUE}} is used to easily put in the standard content for grouping and total rows. For example, for summary row, &#x7B;&#x7B;VALUE}} could be replaced with the **Type: ABC (10 Records)**. This works great, but it assumes you want the data formatted as "&#x7B;&#x7B;GROUPING\_LABEL}}: &#x7B;&#x7B;GROUPING\_VALUE}} (&#x7B;&#x7B;GROUPING\_COUNT}} Records)". This is the Salesforce and Unaric Reports default. But what if you want to change it? That is where the advanced data variables come in. With advanced data variables, Unaric Reports includes a variable for each dynamic data item. You can use the **Table Type 2 - Full (All Variables).docx** template above as a good starter template.

| **Variable Token**            | **Description**                                                                                        |
| ----------------------------- | ------------------------------------------------------------------------------------------------------ |
| `{{GROUPING_LABEL}}`          | Name of the field that the data is grouped by.                                                         |
| `{{GROUPING_VALUE}}`          | Value of the field that the data is grouped by.                                                        |
| `{{GROUPING_COUNT}}`          | Total number of records in the grouping.                                                               |
| `{{GROUPING_COUNT_LABEL}}`    | The word "Record" (if 1 row in this grouping) or "Records" (if 0 or more than 1 row in this grouping). |
| `{{GRAND_TOTAL_COUNT}}`       | Grand total number of records.                                                                         |
| `{{GRAND_TOTAL_COUNT_LABEL}}` | The word "Record" (if 1 record) or "Records" (if 0 or more than 1 record).                             |


:::

:::ExpandableHeading
### Metric Header Variables

Lightning Metric Header Variable enable you include the metric header values. You can add these tokens as either a table or as stand alone text in the document. You will need to set up a token for each of the metric header's you wish to include. You can add just the label or value for each or both.

| **Variable Token**  | **Description**                                                                                                                                                                                        |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `{{METRIC_LABEL#}}` | This will be the label for the metric header such as 'Total Records'. The # is the metric header index from left to right starting with 1. For example, `{{METRIC_LABEL1}}`, `{{METRIC_LABEL2}}`, etc. |
| `{{METRIC_VALUE#}}` | This will be the value for the metric header such as '11'. Again the # is the metric header index from left to right starting with 1. For example, `{{METRIC_VALUE1}}`, `{{METRIC_VALUE2}}`, etc.      |


:::

:::ExpandableHeading
### Utility tokens

Utility tokens are special parameters used to control the visual output, row behaviour, and dynamic date values within your reports.

| **Variable Token**                  | **Description**                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{AUTO_FIT_WIDTHS}}`               | If using Type 2, place this between `{{HEADER_ROW}}` and your column label and Unaric Reports will automatically adjust the width of each column to fit the data within it.                                                                                                                                                                                |
| `{{AUTO_FIT_HEIGHTS}}`              | If using Type 2, place this between `{{HEADER_ROW}}` and your column label and Unaric Reports will automatically adjust the height of each column to fit the data within it.                                                                                                                                                                               |
| `{{NO_HYPERLINK}}`                  | This token allows you to set remove hyperlinks to Salesforce records. Add this token directly after your value token with no space in between. For example, `{{VALUE}}{{NO_HYPERLINK}}`.                                                                                                                                                                   |
| `{{AUTO_FIT}}`                      | You can include this token in the same cell directly after the Report Chart token in order to fit the row to the height of the chart image. (Example: `{{REPORT_CHART}}{{AUTO_FIT}}`) Doing so helps the chart fit better instead of displaying over the top of any data below it. This feature will only work for a chart with a height of 540px or less. |
| `{{DELETE_ROW}}`                    | To delete a row after the data has been merged, add this token. This can be helpful, for example, if you are creating a CSV file and need to exclude the header row.                                                                                                                                                                                       |
| `{{DELETE_COLUMN}}`                 | To delete a column after the data has been merged, add this token. This can be helpful if you are needing to remove a column that was only used for calculation purposes but does not need to be included in the final output.                                                                                                                             |
| `{{DASHES_TO_BLANK}}`               | This token allows you to set null (-) Salesforce values to blank. Add this token directly after your value token with no space in between. For example, `{{VALUE}}{{DASHES_TO_BLANK}}`.                                                                                                                                                                    |
| `{{DATE}}`                          | Today's date value - format is M/d/yyyy (example: 10/3/2021).                                                                                                                                                                                                                                                                                              |
| `{{FULL_DATE}}` or `{{TODAY}}`      | Today's full date value - format is MMMM dd, yyyy (example: October 30, 2021)                                                                                                                                                                                                                                                                              |
| `{{DATE_TIME}}`                     | Today's date time value - format is M/d/yyyy h\:mm a (example: 10/3/2021 1:07 am)                                                                                                                                                                                                                                                                          |
| `{{PREVIOUS_WEEK_DATE}}`            | Last week's date value - format is M/d/yyyy (example: 10/3/2021).                                                                                                                                                                                                                                                                                          |
| `{{PREVIOUS_MONTH_DATE}}`           | Last month's date value - format is M/d/yyyy (example: 10/3/2021).                                                                                                                                                                                                                                                                                         |
| `{{PREVIOUS_MONTH_FIRST_DAY_DATE}}` | First day of the previous month - format is M/d/yyyy (example: 1/1/2022).                                                                                                                                                                                                                                                                                  |
| `{{PREVIOUS_MONTH_LAST_DAY_DATE}}`  | Last day of the previous month - format is M/d/yyyy (example: 1/31/2022).                                                                                                                                                                                                                                                                                  |


:::

:::ExpandableHeading
### Custom format tokens

This set of tokens further extend the control of the data values. Using the custom format tokens, you can display the data in any format you want.

- **\\\\@** Allows formatting of dates
- **\\\\+ or \\\\-** Allows you to add or subtract days to any Date token
- **\\\\#** Allows formatting of numbers and currencies

| **Variable Token**                                      | **Description**                                                                                                                                                                           |
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `\\@`                                                   | Allows formatting of dates                                                                                                                                                                |
| `\\+` or `\\-`                                          | Allows you to add or subtract days to any Date token                                                                                                                                      |
| `\\#`                                                   | Allows formatting of numbers and currencies                                                                                                                                               |
| `{{DATE\\@MMMM d, yyyy}}` or `{{VALUE\\@MMMM d, yyyy}}` | A date with a custom format like above would display with a full month name, the digit of the day number without a leading zero, and the year as a four digit number. Ex. January 1, 2020 |
| `{{DATE\\+14}}` or `{{TODAY\\-7}}`                      | By using the above format, you can add or subtract any number of days from any standard date variable.                                                                                    |
| `{{DATE\\-30\\@MMMM d, yyy}}`                           | You can also combine both of the custom date formatters like above. This way you could do 30 days ago in any format you like.                                                             |
| `{{VALUE\\##,##0.00}}`                                  | The number value will display as a number with two decimals. Ex. 3.14                                                                                                                     |
| `{{VALUE\\#$#,##0.00}}`                                 | The number value will display as a currency value with two decimals. Ex. $3.14                                                                                                            |
| `{{VALUE\\##,##0.00%}}`                                 | The number value will display as a percentage with two decimals. Ex. 3.14%                                                                                                                |


:::

:::ExpandableHeading
### Split currency tokens

Splitting currency fields breaks the currency type and the currency value into their own separate columns. This enables the currency value to be treated as a number field in Excel rather than a plain text field.

| **Variable token**                                                                    | **Description**                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{VALUE_CURRENCY}}` and `{{VALUE_AMOUNT}}`                                           | For this to work you need to use a TYPE2 template. You can use one or both of these tokens. If using both they need to be in separate columns that are next to each other in place of the value token typically used in that cell. |
| `{{FIELD_VALUE.FIELD_API_NAME_CURRENCY}}` and `{{FIELD_VALUE.FIELD_API_NAME_AMOUNT}}` | If you are using FIELD\_VALUE you'll use these tokens, you can use one or both. If using both they need to be in separate columns, in place of the FIELD\_VALUE token typically used in that cell.                                 |
:::

