JS and parameter passing

  • Last update:  2021-02-05
  • I. Description

    When you click the hyperlink, you can also call a JS script and pass parameters to the JS script as shown in the following examples.

    Formatting code is to make the code look good and display the code according to the specification. Many people do not pay attention to the layout structure of the program when they write the program. Although this will not affect the function of the program, the readability of the program will be greatly reduced.

    II. Example - hyperlink to Baidu and transfer value as an example

    Add a hyperlink to the cell, then select JavaScript, add parameter id, select formula for ID value: = $$$, and add JS as follows:

    截屏2021-02-05 上午10.50.22.png

    JS code:

    window.open("https://www.baidu.com/s?&wd="+id);

    III. Example - hyperlink to template and pass value

    Add a hyperlink to the cell, then select JavaScript, add the parameter area, the value of area is string: East China:

    截屏2021-02-05 上午10.57.16.png

    JS code:

    window.open("http://localhost:8075/webroot/decision/view/report?viewlet=GettingStartedEN.cpt&area=" + area);

    Save the template, and the preview effect is as follows:

    Kapture 2021-02-05 at 11.04.04.gif



    IV. Template download

    For completed templates, please refer to:

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\JSPassing.cpt

    Click to download the template: 

    JSPassing.cpt


    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy