Use an iteration a specified number of times



  • In jsreport I can`t find built-in helper like "{{#FOR}}{{/#FOR}}"
    I have to use iteration, a certain number of times.

    For example
    https://playground.jsreport.net/w/anon/Wz3e6jo5

    I will be grateful for your help.



  • In jsreport I can`t find built-in helper like "{{#FOR}}{{/#FOR}}"

    This is mainly handlebars topic.
    You should typically find answers when googling "handlebars something something", because there is like thousand times more handlebars users and resources.

    However...
    You can for example add a condition inside the each.

    {{#each items}}
        {{#if (itemOk this)}}
           ccc
        {{/if}}
    {{/each}}
    

    Or you can implement a helper, that will filter the inputs and returns the final data set for each.

    {{#each (myDataFilter items}}
    {{/each}}
    

    Or you can implement your own each.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.