Displaying the Specified Sheet Tab Page by Default After Page Loading by JS

  • Last update:June 23, 2025
  • Overview

    Version

    Report Server VersionFunctional Change
    11.0/

    Application Scenario

    When multiple sheets exist in a report, the first sheet is displayed by default during the frontend preview.

    However, you may want to display the second sheet by default after selecting Data Entry Preview, as shown in the following figure.

    Implementation Method

    You can add a Loading Start event under Web Attribute > Data Entry Setting to specify the sheet to be displayed initially.

    For details about the API description, see Exclusive API for Data Entry Preview.

    Example

    Template Preparation

    Prepare a report with three sheets and download the prepared template Demographic Statistics Table.cpt.

    Event Adding

    Choose Template > Web Attribute > Data Entry Setting on the menu bar, select Set for This Template Separately, and add a Loading Start event, as shown in the following figure.

    The JavaScript code is as follows.

    if (typeof(tempfirstLoad) == "undefined") {
    _g().loadSheetByIndex(1);
    //Switch to the second sheet.
    tempfirstLoad = false;
    //To prevent the repeated execution of the event, set the global variable to false.
    }

    Effect Display

    iconNote:
    The effect cannot be previewed on mobile terminals.

    Save the report and click Data Entry Preview. The effect is the same as that shown in section "Application Scenario."

    Template Download

    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