Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Scripted Reports use the Handlebars library to render templates, so all the "variables," "if statements," and "for loops" can be used for template rendering.

https://handlebarsjs.com/guide/

Script:

const variableObject = {
    someString: "Hello",
    someNumber: 42,
    someArrayOfString: ["w", "o", "r", "l", "d"],
};

SR.render(variableObject);

Template:

Static text,
{{someString}}
{{#each someArrayOfString}}
  <span>{{this}}</span>
{{/each}}
{{someNumber}}
Static text.

  • No labels