Exclusive API for Data Entry Preview

  • Last update:April 28, 2025
  • Version

    VersionFunctional Change
    11.0

    Difference from V10.0:

    No changes, and all the following APIs are supported in V10.0.

     getWidgetByName

    API  getWidgetByName(name)  To get the widget in the data entry cell by widget name.
    Parameter    namestring

    Widget name, which is a string.

    iconNote: 
    Widgets in cells are unnamed by default. You can set the names in Widget Name.


    Returned Valueobject Widget object, which needs to be used with the widget attribute/API. During cell expansion, this API returns the first widget in the obtained widget array.
    Example In a general report, you can use this API to get the drop-down box widget named comboBox0 from a cell.

    _g().getWidgetByName("comboBox0");

    Application Example During data entry, you can enter the score only once. After the score is entered, the widget becomes disabeld.

    For details, you can download the template Disabling the WidgetAfter Value Input.cpt

    10.gif

    Mobile Terminal  This API is supported on mobile terminals.

    getWidgetByCell

    API
    getWidgetByCell(cell) To get the widget in the data entry cell by cell address. 
    Parametercellstring Cell address, which is a string. 
    Returned Valueobject Widget object, which needs to be used with the widget attribute/API. During cell expansion, this API returns only one widget. The value of cell corresponds to the cell number after expansion. 
    Example Example 1: In a data entry report, you can use this API to get the widget in cell A1.

    _g().getWidgetByCell("A1");

    Example 2: In a data entry report, you can use this API to get the widget in a cell by specifying the column and row numbers. For example, you can get the widget located in the cell at column 1, row 1 (cell A1). The columnRow2CellStr API can convert row and column indices into a cell address. For details about, see the corresponding document.

    _g().getWidgetByCell(FR.columnRow2CellStr({col:0, row:0}))

    Application ExampleDuring data entry, you can enter the score only once. After the value of the widget in cell B4 is obtained, the widget becomes disabeld.

    For details, you can download the template Disabling the Widget After Value Input (by Cell Address).cpt

    10.gif

    Mobile Terminal This API is supported on mobile terminals.

    getWidgetsByName

    APIgetWidgetByName(name) To get the widgets with the same name in the data entry cells by widget name.
         Parameternamestring 

    Widget name, which is a string.

    iconNote: 
    Widgets in cells are unnamed by default. You can set the names in Widget Name.
    Returned ValueobjectWidget object array, which needs to be used with the widget attribute/API. During cell expansion, this API returns the widget object array.
    Example In a general report, you can use this API to get the drop-down box widget named comboBox0 from a cell.

    _g().getWidgetsByName("comboBox0");

    Application

     Example 

    During data entry, you can click the button to get all the extended values of the radio button group widget.

    Mobile 

    Terminal 

    This API is supported on mobile terminals.

    appendReportRC

    API appendReportRC(num,cell) To insert rows at a specific position. You need to set the expansion attribute for the specified cell. 
    Parameter

    num: number

    cell: string

    num: number of rows to be inserted, which is a number.

    cell: cell address where insertion occurs. number of the cell where the row is inserted. Without this parameter, the insertion occurs at the row where the cursor is located.

     Returned Value void
     Example In a data entry report, you can insert three rows after the row where cell A1 is located.

    _g().appendReportRC(3,"A1");

    Application Example During data entry, you can click the button and insert the custom number of rows.

    For details, you can download the template Inserting Rows at a Specified Position.cpt

    9.gif

     Mobile Terminal This API is not supported on mobile terminals.

    appendReportRow

    API _g().appendReportRow(cell,sheetindex,num) 

    To insert rows with an Insert Row button.

    iconNote: 
    When using the num parameter, you are advised to set Number of Rows of the Insert Row button to zero. Otherwise, the row insertion triggered by the button and the row insertion controlled by the num parameter may interfere with each other, leading to unexpected behavior.


      Parameter 

    cellstring

    sheetindexnumber

    numnumber

    cell: cell address where the Insert Row button is located, which is a string.

    sheetindex: sheet number, which is a number starting from zero.

    num: number of rows to be inserted, which is a number.

     

    Returned Valuevoid
      Example Example 1:

    In a data entry report, the Insert Row button is located in cell F1 of sheet1.

    You can insert three rows by using the button in cell F1 with the following JavaScript code.

    _g().appendReportRow("F1", 0,3);

    Example 2: You can insert three rows after obtaining the Insert Row button and the sheet number by using this.options.location and this.options.reportIndex.

    report.appendReportRow(this.options.location,this.options.reportIndex,3);

    Example 3: In a data entry report, you can insert three rows after obtaining the Insert Row button and sheet number by using this.options.location and this.options.reportIndex.

    _g().appendReportRow(this.options.location,this.options.reportIndex,3);

     Application 

    Example 

    During data entry, you can click the button, and customize the number of  the rows to be inserted.
    Mobile Terminal This API is supported on mobile terminals.

    deleteReportRC 

    API deleteReportRC(cell) 
     To delete rows. 
    Parameter cellstringcell: cell address for the row to be deleted. Without the parameter, the row where the cursor is located will be deleted.
     Returned Value  void
    Example Example 1: In a data entry report, you can delete the row where cell A1 is located.

    _g().deleteReportRC("A1");

    Example 2: In a data entry report. you can delete the row where the cursor is located.

    _g().deleteReportRC();

     

    Application Example During data entry, you can click the button to delete the row where the cursor is located.
     Mobile TerminalThis API is not supported on mobile terminals.

    deleteRows

    API deleteRows([cell])   To delete rows.
     Parameter cellstringcell: array of cell addresses for the rows to be deleted.
    Returned Value void
        ExampleIn a data entry report, you can delete the rows where cell A1 and cell A2 are located. 

    _g().deleteRows(['A1','A2']);

     

    Application ExampleIn a data entry report, you can delete rows in batches by selecting the corresponding checkboxes.
    Mobile Terminal   This API is not supported on mobile terminals.

    refreshAllSheets

    API refreshAllSheets() To requery and refresh all sheets, after which the last viewed sheet will be presented. 
    Parameter --
     Returned Value  void
    Example In a data entry report, you can refresh all sheets.

    _g().refreshAllSheets();

      Application Example You can click the button to refresh all sheets. After the refresh, the current sheet (sheet 3) will still be displayed.

    For details, you can download the template Staying on the Current Sheet After Refresh.cpt

    8.gif

     Mobile Terminal  This API is supported on mobile terminals.

    loadSheetByIndex

    API loadSheetByIndex(index) To switch to the specified sheet by sheet number. 
     Parameter indexnumberindex: sheet number, which starts from zero.
     Returned Value  void
    Example 

    In a data entry report, you can switch to the second sheet.

    _g().loadSheetByIndex(1);

      Application Example 

    When multiple sheets exist in a report, you can set the second sheet to be displayed by default during preview.

    For details, you can download the template Displaying the Sheet with the Specified Name by Default.cpt

    7.gif

    Mobile TerminalThis API is not supported on mobile terminals.

    loadSheetByName

    APIloadSheetByName(name) To switch to the specified sheet by sheet name. 
      Parameter namestringname: sheet name
     Returned Value void
    Example In a data entry report, you can switch to the sheet named Product.

    _g().loadSheetByName("Product");

      Application Example 

    When multiple sheets exist in a report, you can set the sheet named sheet2 to be displayed by default during preview.

    For details, you can download the template Displaying the Sheet with the Specified Name by Default.cpt

    7.gif

    Mobile TerminalThis API is not supported on mobile terminals.

    writeReport

    API writeReport(sheetindex) To forcibly submit the report without verification. 
       Parametersheetindex: numberThe serial number of the sheet to be submitted, starting from zero. When this parameter is null, all sheets will be submitted.
     Returned Valuevoid
    Example In a data entry report, you can submit the second sheet.

     _g().writeReport(1);

      Application ExampleYou can customize a Submit button and submit the report content by clicking the button.

    For details, you can download the template Force Submission Without Verification.cpt

    6.gif

     Mobile TerminalThis API is supported on mobile terminals.

    verifyAndWriteReport

    API verifyAndWriteReport(isallsheet)  To verify data and submit the report. 
       Parameter isallsheetboolean 

    isallsheet: Determines whether to submit all sheets.

    true: Submit all sheets.

    false: Submit the current sheet.

    Returned Value void
    Example In a data entry report, you can submit all sheets.

    _g().verifyAndWriteReport(true);

      Application Example You can customize a Submit button, and verify and submit the content by clicking the button.

    For details, you can download the template Submission with Verification.cpt

    5.gif

    Mobile Terminal This API is supported on mobile terminals.

    verifyReport

    API verifyReport()   To verify the report data. 
     Parameter--
    Returned Value  void
    ExampleIn a data entry report, you can submit data for verification.

    _g().verifyReport();

    Application Example You can customize a Verify button, and submit and verify the data by clicking the button.

    For details, you can download the template Custom Verify Button.cpt

    4.gif

    Mobile TerminalThis API is supported on mobile terminals.

    importExcel

    APIimportExcel(importStyle)   To import Excel files. 
    Parameter importStyle

    Import mode, which is a string. 

    If this parameter is not provided, the general import is used. 

    customize: The custom import is used.

       Returned Value void
         ExampleExample 1: In a data entry report, you can bring up a pop-up window for Excel import, and import an Excel file using the general import method.

    _g().importExcel();

    Example 2: In a data entry report, you can bring up a pop-up window for Excel import, and import an Excel file using the custom import method.

     _g().importExcel("customize");

     Application Example

    You can customize an Import Excel button. After clicking the button, you can  import an Excel file.

     For details, you can download the template Custom Excel Import.cpt

    Mobile Terminal This API is not supported on mobile terminals.

    importExcel_Clean

    API importExcel_Clean()   To import an Excel file using Clear Import
      Parameter --
     Returned Valuevoid
       Example In a data entry report, you can bring up a pop-up window for Excel import, and import an Excel file using Clear Import.

    _g().importExcel_Clean();

      Application 

    Example 

    You can customize an Import Excel button. After clicking the button, you can import an Excel file using Clear Import.

    For details, you can download the template Multiple Excel Imports.cpt

    Mobile Terminal This API is not supported on mobile terminals.

    importExcel_Append

    APIimportExcel_Append()  To import an Excel file using Incremental Import
     Parameter --
    Returned Valuevoid
     Example In a data entry report, you can bring up a pop-up window for Excel import, and import an Excel file using Incremental Import.

     _g().importExcel_Append();

     Application Example You can customize an Import Excel button. After clicking the button, you can import an Excel file using Incremental Import.

    For details, you can download the template Multiple Excel Imports.cpt

    Mobile Terminal This API is not supported on mobile terminals.

    importExcel_Cover

    APIimportExcel_Cover()  To import Excel files by Cover Import
      Parameter -
    -
    Returned Value   void
    Example In a data entry report, you can bring up a pop-up window for Excel import, and import an Excel file using Overwrite Import.

    _g().importExcel_Cover();

      Application Example You can customize an Import Excel button. After clicking the button, you can import an Excel file using Overwrite Import.

     For details, you can download the template Multiple Excel Imports.cpt

    Mobile Terminal This API is not supported on mobile terminals.

    isDirtyPage

    API isDirtyPage()  To determine whether a page has been edited. 
    Parameter --
    Returned Value  boolean 

    The value indicating whether a page has been edited, which is a boolean value.

    true: Indicates that the page has been edited.

    false: Indicates that the page has not been edited.

     Example In a data entry report, you can determine whether a page has been edited.

     _g().isDirtyPage();

      Application Example You can click the button to determine whether a page has been edited.

    For details, you can download the template Viewing the Editting Status.cpt

    3.gif

    Mobile Terminal  This API is not supported on mobile terminals.

    isAutoStash

    API
    isAutoStash() To determine whether auto-stash is enabled. For details about auto-stash, see Data Entry Stash (Temporary Storage). 
       Parameter --
     Returned Value boolean 

    The value indicating whether  auto-stash is enabled, which is a boolean value.

    true: enabled

    false: disabled

    Example In a data entry report, you can determine whether auto-stash is enabled.

    _g().isAutoStash();

    Application Example -
    Mobile Terminal This API is not supported on mobile terminals.

    stash

    API stash(undefined,true)   To stash data. 
    Parameterundefined,true Fixed format, used to display a prompt for successful stashing. If you do not need the prompt, you can leave the parameters out.
       Returned Value void
    Example Example 1: In a data entry report, you can stash the data, after which the success prompt will pop up.

    _g().stash(undefined,true);

    Example 2: In a data entry report, you can stash the data without the pop-up success prompt.

    _g().stash();

      Application 

    Example 

    -
    Mobile Terminal  This API is not supported on mobile terminals.

    clear

    APIclear() 
       To clear the stashes. 
      Parameter-None. If you do not need the confirmation  and  success prompts, you can enter undefined,false.
     Returned Value   void
       ExampleExample 1: In a data entry report, you can clear the stashes, after which the success prompt will pop up.

    _g().clear();

    Example 2: In a data entry report, you can clear the stashes without the confirmation and success prompts.

    _g().clear(undefined,false);

      Application Example -
    Mobile TerminalThis API is not supported on mobile terminals.

        

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    8s后關閉

    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