API for Getting and Setting Cell Value

  • Last update:  2022-02-14
  • getCellValue

    MethodgetCellValue(sheetindex,address|row,col)

    Get the value of a specific cell, the parameter can be the cell address or the cell row and column number

      Parameter

    address: string

    row: number, col: number

    sheetindex:Fill in the sheetindex number, starting from 0, if omitted, the default is the first sheet

    address:Cell address, string, such as 'A1', specifying sheet is not supported when using cell address

    row:Cell row number,number

    col:Cell column number,number

    Return valuevoid
       Example

    Example 1: If the obtained report block object is defined as report , get the value of cell A1

    Cell address method:

    report.getCellValue("A1");

    Cell row and column numbers method:

    report.getCellValue(1,1);

    Example 2: In a general report, get the value of cell A1 by cell address

    _g().getCellValue("A1");

    Example 3: Get the value of cell A1 in the second sheet under the data entry preview

    _g().getCellValue(1,1,1);

    Example 4: In the dashboardt, get the value of cell A1 of report0 report block by cell address

    _g().getWidgetByName('report0').getCellValue("A1");

    Application

    example

    Click the button to get the value of cell A1:

    Click to download the template: 

    Get cell value.cpt

    1.gif

    MobileOnly support general report "Data Entry Preview"

    setCellValue

    MethodsetCellValue(sheetindex,address,value|row,col,value)

    Assign a value to a specific cell, the parameter can be the cell address or the cell row and column number

      Parameter

    address: string

    row: number

    col: number

    value: string

    sheetindex:Fill in the sheetindex number, starting from 0, if omitted, the default is the first sheet

    address:Cell address, string, such as 'A1', does not support specifying sheet when using cell address

    row:Cell row number, number

    col:cell column number, number

    value: The value to assign the point to the cell, string

    Return valuevoid
       Example

    Example 1: If the obtained report block object is defined as report , assign the value of "Order number" to cell A1

    By cell address:

    report.setCellValue("A1","Order number");

    By cell row and column number:

    report.setCellValue(1,1,"Order number");

    Example 2: Assign the value of "Order number" to cell A1 in a general report

    _g().setCellValue("A1","Order number");

    Example 3: Under the data entry preview, assign the value of "Order number" to cell A1 in the 2 sheets

    _g().setCellValue(1,1,"Order number");

    Example 4: In the dashboard, the A1 cell of the report0 report block is assigned the value "Order number"

    _g().getWidgetByName('report0').setCellValue("A1","Order number");

    Application

    example

    Click the button to assign the value "Order Number" to cell A1:

    Click to download the template: 

    Modify cell value.cpt

    2.gif

    MobileOnly support general report "Data Entry Preview"


    Attachment List


    Theme: Secondary Development
    • 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