JS Assign Values to Report Widgets

  • Last update:  2020-12-16
  • I. Overview

    1.1 Requirement

    When the value of a certain widget has been edited, dynamically assign values to other cells or other widgets, as shown below.

     


    1.2 Solution

    Use JS to dynamically assign values to other cells or other widgets when certain widgets have been edited.

    Use contentPane.setCellValue([reportIndex], columnIndex, rowIndex, cv); or contentPane.setCellValue (“cell”, null, cv) to assign values both to cells and widgets.

    Use reportIndex to specify the sheet where cells or widgets are located, starting from0.

    Use columnIndex to specify the column where cells or widgets are located, starting from 0.

    Use rowIndex to specify the row where cells or widgets are located, starting from 0.

    Use cv to represent the values to be assigned to cells or widgets.

    Example:

    contentPane.setCellValue(1,2,3,"abc");

    It represents that C4 in the 4th row of the 3rd column of sheet 2 is assigned the value of abc.

    II. Sample

    2.1 Steps

    1) The report is designed as follows:

      

    2)Select the name widget and add an [After Editing] Event:

    Input the JS code:

    var a = this.getValue();
    contentPane.setCellValue(0, 0, a + "`s Personal Information Registration Form");
    contentPane.setCellValue("B3", null, "Male");

    When a certain widget has been edited, you can dynamically assign values to other cells or widgets. You are allowed to assign fixed values or assign current widget values to previous values. The textbox widget used in this sample can also be replaced with widgets of other types.


    2.2 Effect preview

    Save the template and select [Data Entry Preview]. The preview effect on a PC is shown as below:

    III. Download the template

    Attachment List


    Theme: Data Entry
    • 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