This is the reference page of all elements you can use in Maven Documents Template Builder for Google Sheets. For every element, you can check out basic information about it, the full list of its attributes, and the following specifications:
There are also basic attributes that every element has:
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
name | string | Name of the element. | false | - | false |
hidden | boolean | Determines if the element is visible. | false | false | true |
The Expression column indicates whether an expression can be used as an attribute value.
An iteration component that allows you to output the content of a collection according to a structure that you specify because the whole body of the Repeater element will be shown for every record in the collection. This element can have other elements like Code, Image, or even another Repeater nested inside.
There are two types of Repeater available in Google Sheets: Vertical Repeater and Horizontal Repeater. The type of Repeater is specified in the Direction attribute.
Vertical Repeater repeats rows enclosed by the mdoc:repeater tag. The starting column is the one where the Repeater tag is inserted and the end column is the one defined under the lastCell attribute. If there is no value provided, the end column will be set as the last column in a Google Sheet. An example of Vertical Repeater is shown below.
Horizontal Repeater repeats columns enclosed by the mdoc:repeater tag. The starting row is the one where the Repeater tag is inserted and the end row is the one defined under the lastCell attribute. If no value is provided, then the end row will be set to the last row in a Google Sheet.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
value | string | Collection of records to use in Repeater. | true | - | false |
variable | string | The current record in the iteration. | true | - | false |
direction | string | Repeater direction: vertical or horizontal. | false | standard | false |
lastCell | string | Defines the last column to be repeated for vertical or the last row for horizontal Repeater. | false | - | false |
Notice the # (hashtag) used. It wraps around the "oli" Variable referenced inside Vertical Repeater.
Vertical Repeater above will generate a table like this one:
Now let's look at the example of equivalent Horizontal Repeater:
It will generate a table like this one:
There is also a possibility to use the Index expression inside Repeater. This expression returns the index of the repeating variable inside Repeater.
This element allows you to render an image from the specified URL or use base64 data.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
Source | string | base64 data of the image. | true | - | true |
width | integer | Width of the image in pixels. | false | - | true |
height | integer | Height of the image in pixels. | false | - | true |
mode | integer | The sizing mode for the image. | false | 1 | true |
insideCell | boolean | Determines if an image will wrap inside a cell. | false | false | true |
Mode property can have one of the following values:
Note that no mode causes the cell to be resized to fit Image. The default value for Mode is 1, however, if height and width are specified then the default value is 4.
Here we have a few different examples of different usage for the mdoc:image element:
Here is an example of the created document:
You can also use Image to place charts into the document. Here is the tip on how to do it.
Renders different codes (QR Codes, Barcodes, etc) on the document.
Attribute Name | Type | Description | Required | Default Value | Expression |
---|---|---|---|---|---|
type | string | Code type | true | - | true |
value | string | A textual value that will be replaced with the code. | true | - | true |
scale | integer | A scale of the rendered code. Must be integer > 0. | false | 2 | true |
rotate | string | Allows rotating the image to one of the four orthogonal orientations. | false | N | true |
includeText | Boolean | Displays the text below the code for some code types (e.g. code128) | false | false | true |
width | integer | Width of the image in pixels. | false | - | true |
height | integer | Height of the image in pixels. | false | - | true |
mode | integer | The sizing mode for the image. | false | 1 | true |
insideCell | boolean | Determines if the image will wrap inside a cell. | false | false | true |
Mode, Width, Height, and insideCell behave the same as in the Image element.
Here are a few examples of the mdoc:code element:
Here is the result file: