Cell Object API

  • Last update:May 23, 2025
  • Version

    Report Server Version Functional ChangeMobile Terminal Version
    11.0- 

    Difference from V10.0:

    Such API is not provided in V10.0.

    11.0.7- Added getPosition API, getRow API, getColumn API, getValue API, showToolTip API, and setStyle API in the FRM report.
    11.0.7 - Installed FineVis Data Visualization plugin of V1.8.0 and later versions, and allowed you to set getPosition API, getRow API, getColumn API, getValue API, showToolTip API, and setStyle API in FVS visualization dashboards.
    11.0.1011.0.70Allowed you to set getPosition API, getRow API, getColumn API, getValue API, showToolTip API, and setStyle API in general reports. 
    11.0.19 -

    Added setValue() API in the dashboard, and adapted the API to the FineVis Data Visualization plugin of V 1.17.0.

    Before API use, read JS API Compatibility Description carefully. APIs are supported in both general reports and FRM reports (new version) by default.  

    getPosition()

    APIgetPosition() To obtain the current cell position, requiring you to get the cell object first.
    Parameter 

     Returned ValuePositionArray The cell position, which is an array with indices starting from 0 (0 for the row, 1 for the column). 
        Example

    Example 1: You can obtain the positions of the cell row and cell column as well as the current cell position of the obtained cell defined as cell.

    cell.getPosition();//To obtain the position of the cell object defined as cell

    cell.getPosition()[0];//To obtain the row position of the cell object defined as cell

    cell.getPosition()[1];//To obtain the column position of the cell object defined as cell

    Example 2: In the FRM report, you can obtain the position information of cell A1 in the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).getPosition();

    Example 3: In a general report, you can obtain the position information of cell A1.

     _g().getCell(1,1).getPosition();

    Example 4: In the FVS visualization dashboard, you can obtain the position information of cell A1 in the component Table1.

     duchamp.getWidgetByName("Table1").getCell(1,1).getPosition();

    Example 5: In the FRM dashboard, you can set a pop-up prompt about the row and column information of cell A1 in the report block report0.

    var row=_g().getWidgetByName('report0').getCell(1,1).getPosition()[0];

    var col=_g().getWidgetByName('report0').getCell(1,1).getPosition()[1];

    FR.Msg.alert("prompt","the row position of cell A1 is"+row+"the column position is"+col);

     Application

     Example 

    You can click the button to bring up the pop-up prompt in which the row and column information of cell A1 in report block report0 is displayed. 

    For details, you can download the template Obtaining the Cell Object Position.frm

    FVS visualization dashboard: Obtaining the Cell Object Position.fvs

    21.gif

    Mobile Terminal This API is supported on mobile terminals.

    getRow()

    API getRow() To obtain the cell object of the row where the current cell is located, and the returned row object can be set by the methods on row objects.
    Parameter --

    Returned 

    Value 

    ObjectRow cell object (JSON). When the cells are merged, the cell row object group will be returned. Assuming that cell A1 and cell A2 are merged, then the objects of the first row and the second row will be returned.
    Example Example 1: If the obtained cell object is defined as cell, you can obtain the cell object of the row where the current cell is located. 
    cell.getRow();

    Example 2: In the FRM dashboard, you can obtain the cell object of the row where cell A1 in the report block report0 is located.

    _g().getWidgetByName('report0').getCell(1,1).getRow();

    Example 3: In a general report, you can obtain the cell object of the row where cell A1 is located.

    _g().getCell(1, 1).getRow();

    Example 4: In the FVS visualization dashboard, you can obtain the cell object of the row where cell A1 in the component Table1 is located.

    duchamp.getWidgetByName("Table1").getCell(1,1).getRow();

    Example 5: In the FRM report, you can modify the text color to red and the font size to 14 for the content in the row where cell A1 is located in the report block report0.

    _g().getWidgetByName('report0').getCell(1, 1).getRow().setStyle({

     fontSize: 14,

     color: 'red'

    });
    Application Example In the FRM report, you can modify the text color to red and the font size to 14 for the content in the row where cell A1 is located in the report block report0. 

    For details, you can download the template Modifying the Row Style.frm

    FVS visualization dashboard: Modifying the Row Style.fvs.

    1.gif

    Mobile 

    Terminal

    This API is supported on mobile terminals.

    getColumn()

    API   getColumn() To get the cell object of the column where the current cell is located, and the returned column can be set by the methods on column objects.
         Parameter 

    Returned Value ObjectColumn cell object (JSON) When the cells are merged, the cell column object group will be returned. Assuming that cell A1 and cell A2 are merged, then the objects of the first column and the second column will be returned.
      Example Example 1: If the obtained cell object is defined as cell, you can obtain the cell object of the column where the current cell is located.
    cell.getColumn();

    Example 2: In the FRM report, you can obtain the cell object of the column where cell A1 in the report block report0 is located.

    _g().getWidgetByName('report0').getCell(1,1).getColumn();

    Example 3: In a general report, you can obtain the cell object of the column where cell A1 is located.

    _g().getCell(1,1).getColumn();

    Example 4: In the FVS visualization dashboard, you can obtain the cell object of the column where cell A1 in the component Table1 is located.

    duchamp.getWidgetByName("Table1").getCell(1,1).getColumn();

    Example 5: In the FRM report, you can modify the text color to red and the font size to 14 for the content in the column where cell A1 is located in the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).getColumn().setStyle({

     fontSize: 14,

     color: 'red'

    });


    Application 

    Example 

    In the FRM report, you can modify the text color to red and the font size to 14 for the content in the column where cell A1 is located in the report block report0. 

    For details, you can download the template Modifying the Column Style.frm. 

    FVS visualization dashboard: Modifying the Column Style.fvs.

    2.gif

     Mobile Terminal This API is supported on mobile terminals.

    getValue

    API   getValue() To obtain the type and the value of a cell.
     Parameter 

    Returned 

    Value 

    stringCell type and cell value
    Example Example 1: If the obtained cell is defined as cell, you can obtain the type and the value of the current cell.
    cell.getValue();

    Example 2: In the FRM report, you can obtain the type and the value of cell A1 in the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).getValue();

    Example 3: In a general report, you can obtain the type and the value of cell A1.

    _g().getCell(1,1).getValue();

    Example 4: In the FVS visualization dashboard, you can obtain the type and the value of cell A1 in the component Table1.

    duchamp.getWidgetByName("Table1").getCell(1,1).getValue();

    Example 5: In the FRM report, you can set a pop-up prompt about printing the type and the value of cell A1 in the report block report0.

    var a=_g().getWidgetByName('report0').getCell(1,1).getValue();

    FR.Msg.alert("Prompt", "The value of cell A1 is"+a);


    Application Example In the FRM report, you can set a pop-up prompt about printing the type and the value of cell A1 in the report block report0.

    For details, you can download the template Displaying the Cell Value by Clicking.frm.

    FVS visualization dashboard: Obtaining the Cell Value.fvs.

    3.png

    Mobile 

    Terminal 

    This API is supported on mobile terminals.

    However, when getCell is used with getValue, such as

     _g().getCell(1,1).getValue();

    , the effect cannot be displayed in the data entry preview.

    setValue

    iconNote: 
    This API is not supported in general reports.

    API setValue(value) To set the value of a cell.
     Parameter value: anyCell value in any format.
     Returned Value void
    Example 

    Example 1: In the FVS visualization dashboard, you can assign the value other regions to the component Table1 in cell A1.

    duchamp.getWidgetByName("Table1").getCell(1,1).setValue("other regions");

    Example 2: In the FRM report, you can assign the value other regions to cell A1 in the report block report0.

    _g().getWidgetByName("report0").getCell(1,1).setValue("other regions");


      Application Example 

    For details, you can download the template Modifying the Cell Value by Clicking.fvs.

    4.gif

    Mobile Terminal  This API is not supported on mobile terminals.

    showToolTip

    API showToolTip(opts)To add tooltips to a cell.
      Parameter 

    opts: Object

    {

        showboolean,

        content: {

            text: string, // text

            imagestring, // image

            headerstring // title

        }

        style: {

        } 

    }

    iconNote: 
    The header and image parameters are not supported in general reports.

    opts: pop-up option, which is an object.

    1. show: whether to show a pop-up window, which is a boolean. true: to show the pop-up window. false: not to show the pop-up window.

    2. content: You can select a field, or the cell value will be displayed.

    text: the prompt content, which is a string.

    image: URL path to the image, which is a string. The supported image formats include PNG and JPG. The image source can be a web page, as shown in the following figure.

    Alternatively, you can place the image in the report project directory %FR_HOME%\webapps\webroot and access it via URL, as shown in the following figure.

    header: the title.

    3. style: You can select a field, or the default style will be displayed. For details about supported styles, see Style Attribute.

     Returned Value --
    Example Example 1: You can define the obtained cell as cell, set a prompt box whose title is Prompt and the content is Regional Sales Data in red.
    cell.showToolTip({

     show: true, // Whether to show the pop-up window

     content: { // To select a field or display the text

      text: "Regional Sales Data", // The text

      header: "Prompt" // The title

     },

     style: { // To select the field supported by CSS specifications or display the default style

      color: "#DC143C"

    // Follow the CSS specifications

     }

    });

    Example 2: In the FRM report, you can set a prompt box whose title is Prompt and the content is Regional Sales Data in red for the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).showToolTip({

     show: true, // Whether to show the pop-up window

     content: { // To select a field or display the content cell.getValue();

      text: "Regional Sales Data", // The text

      header: "Prompt" // The title

     },

     style: { // To select the field supported by CSS specifications or display the default style

      color: "#DC143C"

    // Follow the CSS specifications

     }

    });

    Example 3: In a general report, you can set a prompt box whose title is Prompt and the content is Regional Sales Data in red for cell A1.

    _g().getCell(1,1).showToolTip({

     show: true, // Whether to show the pop-up window

     content: { // To select a field or display the content cell.getValue();

      text: "Regional Sales Data", // The text

      header: "Prompt" // The title

     },

     style: { // To select the field supported by CSS specifications or display the default style

      color: "#DC143C"

    // Follow the CSS specifications

     }

    });

    Example 4: In the FVS visualization dashboard, you can set a prompt box whose title is Prompt and the content is the cell value for cell A1 in the component Table1.

    duchamp.getWidgetByName("Table1").getCell(1,1).showToolTip({

     show: true, // Whether to show the pop-up window

     content: { // To select a filed or display the text

      header: "Prompt" // The title

     }

    });

    Example 5: In the FRM report, you can set a prompt box whose title is Prompt and the content is the cell value for the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).showToolTip({

     show: true, // Whether to show the pop-up window

     content: { // To select a field or display the text

      header: "Prompt" // The title

     }

    });


     Application 

    Example 

    In the FRM report, you can set a prompt box whose title is Prompt and the content is the cell value for cell A1 in the report block report0.

    For details, you can download the template Text Tooltip in Cells with Hovering Cursor.frm.

    FVS visualization dashboard: Text Tooltip in Cells with Hovering Cursor.fvs.

    5.png

    Mobile Terminal
     This API is not supported on mobile terminals.

    setStyle

    APIsetStyle(opts)To set the cell style.
    Parameter 

    opts: Object 

    {

        fontFamilyString

        fontSizenumber

        fontWeightString

        colorString

      ........ 

    }

    opts: cell style attributes such as border and font color.

    For details about supported attributes, see Style Attribute.

       Returned 

    Value 

    --
    Example Example 1: You can set the font color to red and font size to 14 for the obtained cell named cell.
    cell.setStyle({

     fontSize: 14,

     color: 'red'

    });

    Example 2: In a general report, you can set the font color to red and font size to 14 for cell A1.

    _g().getCell(1,1).getValue();

     fontSize: 14,

     color: 'red'

    });

    Example 4: In the FVS visualization dashboard, you can set the font color to red and font size to 20 for cell A1 in the component Table1.

    duchamp.getWidgetByName("Table1").getCell(1,1).setStyle({

     fontSize: 20,

     color: 'red'

    });

    Example 5: In the FRM report, you can set the font color to red and font size to 14 for cell A1 in the report block report0.

    _g().getWidgetByName('report0').getCell(1,1).setStyle({

     fontSize: 14,

     color: 'red'

    });


    Application 

    Example 

    In the FRM report, you can set the font color to red and font size to 14, and make the font bold by clicking the button.

    For details, you can download the template Modifying Cell Style after Obtaining the Cell.frm.

    FVS visualization dashboard: Modifying Cell Style after Obtaining the Cell.fvs.

    6.gif

    Mobile 

    Terminal

    This API is supported on mobile terminals.

    cellStr2ColumnRow

    APIcellStr2ColumnRow(cell) To obtain row and column indexes based on the cell number.
     Parameter cell Cell number

    Returned 

    Value

      {col:colindex, row:rowindex} 

    Row and column indexes in JSON format

    col: column index, starting from 0

    row: row index, starting from 0

     Example Example 1: In a general report or FRM report, you can obtain the row and column information of cell A1. 
    FR.cellStr2ColumnRow("A1");

    Example 2: In a general report or FRM report, you can use this API to print the row number of cell A1.

    var a=FR.cellStr2ColumnRow("A1").row+1;

    FR.Msg.alert("Prompt", "The row number of cell A1 is"+a);

    Example 3: In an FVS template, you can print the row and column number of a cell.

    var a=duchamp.cellStr2ColumnRow("A3").col+1;

    var b=duchamp.cellStr2ColumnRow("A3").row+1;

    //alert(a);

    duchamp.Msg.alert({

        title: "Prompt",

        message:  "The column number of cell A3 is"+a,

    });

    duchamp.Msg.alert({

        title: "Prompt",

        message:  "The row number of cell A3 is"+b,

    });


      Application 

    Example 

    In the general report, you can click the button to print the row number of cell A1.

    In the FVS template, you can click the button to print the row and column numbers of cell A3.

    For details, you can download the template Printing the Row and Column Numbers of A Cell.fvs.

    7.gif

      Mobile 

    Terminal

     This API is supported on mobile terminals.

    columnRow2CellStr

    API columnRow2CellStr({col:colindex, row: rowindex}) To obtain the cell number based on the row and column number.
    Parameter  {col:colindex, row:rowindex} 

    Row and column indexes in JSON format

    col: column index, starting from 0

    row: row index, starting from 0

     Returned 

    Value 

    cell Cell number
     Example Example 1: In a general report or FRM report, you can obtain the cell number of the cell with row index 3 and column index 1.
    FR.columnRow2CellStr({col:1, row:3});

    Example 2: In a general report or FRM report, you can print the cell number of the cell with row index 3 and column index 1.

    var a=FR.columnRow2CellStr({col:1, row:3})

    FR.Msg.alert("Prompt", "The cell number of the cell with row index 3 and column index 1 is "+a);

    Example 3: In an FVS template, you can print the cell number of the cell with row index 3 and column index 1.

    var a=duchamp.columnRow2CellStr({col:1, row:3})

    duchamp.Msg.alert({

        title: "Prompt",

        message: "The cell number of the cell with row index 3 and column index 1 is"+a,

    });


     Application Example In the general report, you can print the cell number of the cell with row index 3 and column index 1.

    In the FVS template, you can print the cell number of the cell with row index 3 and column index 1.

    For details, you can download the template Obtaining the Cell Number Based on the Row and Column Number.fvs.

    8.gif

     Mobile 

    Terminal

    This API in the general report or FRM report is not supported on mobile terminals. This API in the FVS template is supported on mobile terminals.

     

    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