Menu

Used report parameters inside javascript

ART Help
2021-10-21
2021-11-08
  • Sergey Zakharov

    Sergey Zakharov - 2021-10-21

    Hi!
    How can used inside javascript (new separate field in the reports or as
    template file) report parameters (like #Param1#, #Param2# etc) ?
    So useful...
    --

    Best regards, Sergey

     
  • Sergey Zakharov

    Sergey Zakharov - 2021-10-21

    May be exists global object with many ART fields?

     
  • Timothy Anyona

    Timothy Anyona - 2021-10-23

    This is not currently available but report parameters will be available in the javascript field in the next release.

     
  • Sergey Zakharov

    Sergey Zakharov - 2021-10-24

    Great news!
    Thank you.

     
  • Sergey Zakharov

    Sergey Zakharov - 2021-11-07

    In new 5.12 release may using small addition for showXXX.jsp

    <script type="text/javascript">
        var reportParams = {}
    </script>
    
    <c:forEach items="${reportParamsMap}" var="entry">
        <script type="text/javascript">
            reportParams["${entry.key}"] =  "${reportParamsMap[entry.key].value}" 
        </script>
    </c:forEach>   
    
     

    Last edit: Sergey Zakharov 2021-11-07
  • Timothy Anyona

    Timothy Anyona - 2021-11-08

    OK. Could you give an example on how you plan to use the values?

     
  • Sergey Zakharov

    Sergey Zakharov - 2021-11-08

    Inside javascript:

    var configOptions = {
     title:(reportParams['Dashboard'] == 1 ? null : reportParams['Title'])
     ylabel:(reportParams['Dashboard'] == 1 ? null : 'My label for '+reportParams['YLabel']),
     visibility :[true,reportParams['Chart2']==1]
     }
    
     

    Last edit: Sergey Zakharov 2021-11-08

Log in to post a comment.