For with counter JsRender not working in JSReport



  • I'm trying to run this code in JSReport but not working. I'm get Total without value. I'm starting in jsreport, please, help me with this problem.

    {{*window.total = 0}}

    {{for students}}
    {{total += 1}}
    {{/for}}
    total {{
    : total}}


    Data
    {
    "students": [
    {
    "nome": "Rodrigo",
    "cpf": "3432423423"
    },
    {
    "nome": "Jose",
    "cpf": "4134231412"
    }
    ]
    }

    Regards,

    Rodrigo


  • administrators

    hi! you can do what you want without using global variables, just use a helper. take a look at this example.



  • Great! Thank you very much!!!


Log in to reply
 

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