Advanced RowMerge Document Templates

You have already created your first RowMerge template? RowMerge provides a set of variables and syntaxes to generate increasingly sophisticated documents.

One file per row or a single file for all rows?

If you run a RowMerge job on several rows, by default, a ZIP archive is created with a document for each row.

You can specify that you want a single file containing all rows. This is done by adding at the end of the document the {{#beginrows}} , {{#endrows}}and{{#onefile}}instructions.

The {{#onefile}} instruction indicates that only one file will be produced, whereas the{{#beginrows}} and {{#endrows}} tags show which area of the template will be repeated for each of your table's rows. In this case, the full document will be duplicated for each row. But you could have a document header that wouldn't be repeated and therefore left outside of the{{#beginrows}} {{#endrows}}section.

You can download the complete example by clicking here.

You can add options to {{#beginrows}} and {{#joinrows}} to limit loading or to sort rows:

  • Min: set to 0 to avoid line breaks
  • Max: Maximum number of rows loaded
  • OrderBy:Name_Of_The_Column: Sorting in ascending order
  • OrderByDescending:Name_Of_The_Column: Sorting in descending order

File Name: #filename

You can edit the name of the generated file(s) by using the command {{#FileName;name_of_file}}:

As illustrated above, you can add the contents of a column to the file name to make it more descriptive: {{#FileName;Name_of_the_file_{Column}}}.

You can download an example here.

Zip Archive File Name: #zipfilename

Similarly, you can edit the name of the generated archive by using the command {{#ZipFileName;name_of_file}}:

You can download an example here.

Get data from several Tables: #joinrows

Ready to go a step further? You can generate a RowMerge document using data from several tables with the {{#joinrows}} instruction.

You need to let RowShare know how tables relate to each other: each other table needs to share one column with your main table. For example, if you want to join a table of tasks and a table of employees to identify the owner of each task, both tables need to list the task owner name or task owner ID.

This instruction follows this format:

 {{#joinrows;linked_table_ID;column_of_the_current_table;column_of_the_linked_table}}

Here is the explanation of each parameter:

  • linked_table_ID: the id of the external table (you find the ID in its URL, it's the last part after rowshare.com/t/).
  • column_of_the_current_table: the column name in the table hosting the RowMerge template
  • column_of_the_linked_table: the column name in the other table

After having inserted the text you want to repeat for each corresponding row in the other table, add #endrowsto end this section.

 {{#endrows}}

Columns Format

It is possible to specify the display format of your information by using: {{name_of_the_column:format}}.

Here are the main supported formats:

  • {{name_of_the_column:c}}for a currency
  • {{name_of_the_column:p}}for a percentage
  • {{name_of_the_column:d}}for a date
  • {{name_of_the_column:image}}for an image

Columns Format: Focus on Images

For Pictures, you can use additional optional parameters, following this syntax:

{{name_of_the_column:image:horizontal scale:vertical scale:width goal:height goal}

Each setting after image is optional, but you need to include the colons if you use at least one of these parameters:

  • Horizontal Scale and Vertical Scale: Integers representing a percentage. They represent the scale you want to apply to your picture.
  • Width Goal and Heigth Goal: Integers representing the picture target size. Specify only one to keep initial aspect ratio. Width and Height Goals can be specified in 3 units:
    • px: pixels
    • cm: centimeters
    • twips (no format extension)

Examples:

  • {{name_of_the_column:image:50:50::}} Picture resized to 50% of its original height and width
  • {{name_of_the_column:image:::400px:}} 400 pixels wide, automatic width
  • {{name_of_the_column:image::::29cm}} 29 centimeters high, automatic width
  • {{name_of_the_column:image:::500:1000}} 500 twips wide, 1000 twips high

JavaScript and more

In RowMerge document templates, it's also possible to add JavaScript code and use Word table formulas.

Our team at RowShare is also available to create RowMerge templates for you. Share your need and ask for a quote.


How did we do?