Templates
Document Templates
use record handlers to move beyond displaying report data as just table rows normally each row in a report is placed into a table row with record handlers, you can change that behaviour to format the rows using one of four types of record handlers document page block cell the document record handler creates an entire document for each row in a report and then merges all of those documents together to use a document record handler, add the following to the top of the first page of your word document template {{document record handler alias}} example in this example, we are going to create a pdf from a word document template that contains all new opportunities to do this, we will need a solution with the document template and a source report for opportunities that has an alias of 'opportunities' the alias can be whatever you like it just needs to match what you define as your alias in your solution document template solution next, we will add variables from the report into the document template you can find the list of variable names by going to run report page and selecting the info icon report you can put these variables anywhere in your document template document template when the solution runs, it will merge in the fields and repeat a page for each record final pdf page record handler the page record handler creates a new page for each row in a report all within a single document page record handlers work a lot like the document report handler described above, except page record handlers provide more flexibility for including additional pages that aren't repeated for example, you can include a cover page and a summary page to use a page record handler for a tabular report, add the following to the top of the first page you want to repeated in your word document template {{page record handler alias}} to use a page record handler for a report with a grouping, add the following to the top of the first page you want to repeated in your word document template example in this example, we are going to use a tabular report to create a pdf from a word document template that contains all new opportunities just like the example for the document record handler however, this template will include a cover page and a final legal disclaimer page to do this, we will need a solution with the document template show below and a source report for opportunities that has an alias of 'opportunities' the alias can be whatever you like it just needs to match what you define as your alias in your solution if the page/pages that are being repeated are not followed by anything else you can simply use the one token at the beginning however, if you have any static page/pages after that you don't want repeated, you will need to use {{page record handler end alias}} token to define where you would like the pages to stop repeating document template solution note that we have added variables from the report into the document template you can find the list of variable names by going to run report page and selecting the info icon report you can put these variables anywhere in your document template document template when the solution runs, it will merge in the fields and repeat a page for each row from the report, keeping the cover page and final page final pdf block record handler the block record handler creates a new block or section of a document for each row in a report to create a block record handler, add {{block record handler start alias}} and {{block record handler end alias}} tokens around the components you would like repeated example in this example, we are going to use a tabular report to create a pdf that contains all new opportunities just like the example for the document record handler however, this template will repeat the opportunity detail as a block so that more than one opportunity can be included on a page to do this, we will need a solution with the document template show below and a source report for opportunities that has an alias of 'opportunities' the alias can be whatever you like it just needs to match what you define as your alias in your solution document template solution note that we have added variables from the report into the document template you can find the list of variable names by going to run report page and selecting the info icon report when the solution runs, it will merge in the fields and repeat a block for each opportunity record final pdf grouped report in this example, we are going to use a summary report to create a pdf from a word document template that contains all new opportunities just like the example above however, for this example, we will group the opportunities by account and create a new block for each grouping using the {{grouping block record handler start alias}} and {{grouping block record handler end alias}} tokens, with smaller blocks for each row from the report within it document template you can use any of these variables for the grouping {{grouping 1 label}}, {{grouping 1 value}}, {{grouping 1 count}} {{grouping 1 count label}} when the solution runs, it will merge in the fields and repeat a block for each grouping with a block for each opportunity record from the report final pdf cell record handler the cell record handler creates a new table cell for each row in a report this can be helpful when printing out labels or addresses to create a cell record handler, you would add the following to the first cell {{cell record handler alias}} example in this example, we are going to create a list of mailing labels for contacts where which address is in its own cell to do this, we will need a solution with the document template show below and a source report for contacts that has an alias of 'contacts' the alias can be whatever you like it just needs to match what you define as your alias in your solution document template solution note that we have added variables from the report into the document template you can find the list of variable names by going to run report page and selecting the info icon when the solution runs, it will merge in the fields and repeat a cell for each contact record spacing one common issue with with adding record handler tokens is removing the space the token is taking up by default, unaric reports will remove the entire line that the token is on sometimes though you want to keep the line but just remove the token we have added an extra token to all of these features, except repeat cell, to allow you keep the space the token is {{keep space}} and you place it directly after any of the record handler tokens to leave the line in the document for example, if you are doing a page record handler and keep the line that contains the token, it would look like this {{page record handler alias}}{{keep space}} no results message if you would like to insert a message when there is no data, you can place a message the between {{no results message start alias}} and {{no results message end alias}} tokens for example, if you have a template that lists out of the contacts for an account, you can use the following tokens to insert a message when there are no contacts document template final pdf