Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This actionhandler is available from v7.14 and allows you to create and use Excel document templates with values from process variables that usually come from a smartformform.

Variables from VariablesHelper can also be used with this actionhandler.

...

Info

The ExcelTemplateHandler can also be installed in the Smartform Forms as a button to generate a template if required. More information isĀ here.

...

Code Block
POST: [your server url here]/tim/api/templates

{
    // Mandatory params
    "processInstanceId": [YOUR PI ID HERE],
    "template": [YOUR TEMPLATE PATH HERE],

    //Optional params
    "target": "",
    "documentPrefix": "",
    "locale": "",
    "overwriteExisting": false,
    "interpretNumbersAsBoolean": false,
    "interpretBooleanAsHuman": false,
    "removeEmptyTableRows": false,
    "open": false
}

...

Integrating the ExcelTemplateHandler into a HTML-

...

Form

The ExcelTemplateHandler can be integrated into a HTML-Smartform Form as a link, a button, or an image so that the participants can create a template at any time. For this, the following code must be integrated into the smartformform:

Code Block
<button type="button" onbuttonclick="generateFileFromTemplate([{handler:'ExcelTemplateHandler',template:'temp.xlsx',attach:false,open:true,documentPrefix:'Prefix'}])">Generate Excel template</button>

...

The "onbuttonclick" attribute defines which functions/parameters the handler should execute. See Parameters sections above.

...

Important when using HTML-

...

Forms

Normally written text will be inherited, whereas variables will be overwritten if marked as ${Variable-ID}. To overwrite variables with content from the HTML form, you must use the variable's ID, such as ${Variable-ID}, within the text form fields. An exception to this rule applies to radio buttons, where you should use the variable name, like ${Variable-Name}, instead of the variable ID.

...