JS Full-screen Preview by Clicking Button

  • Last update:  2020-12-15
  • I. Overview

    1.1 Problem description

    The report preview in the decision-making platform can perform full-screen display, but if it is not previewed through the decision-making platform, how to preview a single report in full screen?

    Note: This document introduces the method of full-screen display by clicking button in a general report. For the method of full-screen display by clicking button in a dashboard, please refer to the document Click Dashboard to Display in Full Screen.


    1.2 Implementation ideas

    Add a button click event to realize full screen preview.

    Note: This method is only applicable to Google and Firefox browsers.

    You will learn
    • Examples

      • Design report

      • Add a event

      • Preview

    • Download the template

    II. Examples

    2.1 Design report

    Open a built-in template in the designer: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\GettingStartedEN.cpt 

    Add a button widget button0 in the Parameter Panel, and change the button name to full screen display, as shown below:


    2.2 Add a event

    Select the button widget, and click Add Event in widget Settings > Events to add a click event, as shown below:

     

    The JavaScript code is as follows:

    var docElm = document.documentElement;
    //W3C proposal
    if (docElm.requestFullscreen) {
    docElm.requestFullscreen();
    }
    //FireFox browser
    else if (docElm.mozRequestFullScreen) {
    docElm.mozRequestFullScreen();
    }
    //Chrome and other browsers
    else if (docElm.webkitRequestFullScreen) {
    docElm.webkitRequestFullScreen();
    }


    2.3. Preview

    Save the report, click Pagination Preview, and click the full screen button in the Parameter Panel to display the report in full screen. The effect is shown below:

    3.gif 

    Note: Mobile terminal is not supported.

    III. Download the template

    Attachment List


    Theme: Report Application
    • 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