Global API

  • Last update:  2022-02-09
  • The global interface is an interface that can operate the entire report. The methods and attributes of other elements in the report are inherited from the global interface. If you want to get other elements in the report and operate them, you must first use the global interface to get the report object.

    _g()

    Method_g()

    Get the report object, and use it in combination with the methods and attributes of the report object.

      Parameter--
    Return valueobjectreport object
        Example

    Example 1: After obtaining the report object, use the method of the report object to obtain the parameter pane object

    _g().getParameterContainer();

    Example 2: After obtaining the report object, use the method of the report object to obtain the report0 report block object

    _g().getWidgetByName('report0');

    Example 3: After obtaining the report object, use the parameterCommit method of the report object to submit parameters and re-query

    _g().parameterCommit();
    Application exampleAfter selecting the value from the drop-down box in the parameter pane, you can query without clicking the query button, as shown in the following figure:

    For detailed implementation methods, please refer to: JS implements automatic query without clicking the query button

    1.gif

    MobileSupport mobile terminal

    getParameterContainer

    MethodgetParameterContainer()Get the parameter pane object in the report, and use it in combination with the parameter panel interface
      Parameter--
    Return valueobjectparameter pane object
       Example

    Example 1: If the obtained report object is defined as report, obtain the parameter pane object in the report

    report.getParameterContainer();

    Example 2: After obtaining the report object, then get the parameter pane object

    _g().getParameterContainer();

    Example 3: After obtaining the parameter pane object, use its method to obtain the "drop-down box" widget comboBox0 on the parameter pane

    _g().getParameterContainer().getWidgetByName("comboBox0");

    Application

    example

    Assign values to the widget on the parameter pane, as shown in the following figure:

    Click to download the template: 

    Assign values to widget on the parameter pane.cpt

    2.gif

    MobileSupport mobile terminal

    parameterCommit

    MethodparameterCommit()

    After submitting the parameters, re-query and refresh the report

      Parameter--
    Return valuevoid
        Example

    Example 1: If the obtained report object is defined as report, submit the parameters and re-query

    report.parameterCommit();

    Example 2: After obtaining the report object, submit the parameters to re-query

    _g().parameterCommit();

    Application

    example

    After selecting the value from the drop-down box in the parameter pane, you can query without clicking the query button, as shown in the following figure:

    For detailed implementation methods, please refer to: JS implements automatic query without clicking the query button

    3.gif

    MobileSupport mobile terminal

    loadContentPane

    MethodloadContentPane()

    Reload, refresh report

       Parameter--
     Return valuevoid
        Example

    Example 1: If the obtained report object is defined as report, refresh the report

    report.loadContentPane();

    Example 2: After obtaining the report object, refresh the report

    _g().loadContentPane();

    Application

    example

    Click the button to reload the report, as shown below:

    Click to download template: 

    Click the button to reload the report.cpt

    4.gif

    MobileSupport mobile terminal

    getPreviewType

    MethodgetPreviewType()

    Get the preview mode the report is currently in

      Parameter--
    Return valuestring

    String, the current preview mode:

    • preview: cpt pagination preview / frm non-mobile preview

    • view: data analysis

    • write: data entry preview

    • mobile-preview: mobile preview

    • mobile-write: data entry of mobile terminal

        Example

    Example 1: If the obtained report object is defined as report, return the current preview mode of the report

    report.getPreviewType();

    Example 2: Return the current preview mode of the report object

    _g().getPreviewType();

    Application

    example

    When some report functions designed do not support the preview mode of "Data Analysis", a pop-up window reminds:

    Click to download the template: 

    Report preview mode.cpt

    5.png

    MobileSupport mobile terminal



    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