Dynamic report title

  • Last update:  2021-05-11
  • I. Description

    When previewing the template, hoping that the report name can be displayed dynamically instead of being fixed. At this time, you can define parameters in the report title and assign different values to the parameters to change the report title. The implementation process is described in detail below.

    II. Ideas

    It can be achieved by writing a parameter in Template>Web Attributes>Basic>Title, and then assigning a value to the parameter or directly by JS.

    Note: If the report is integrated into a Web page or embedded in other pages, the following method of modifying the title does not apply.

    III. Example1

    1. Open the template

    Open the tempalte: %FR_HOME%\webroot\WEB-INF\reportlets\GettingStartedEN.cpt


    2. Set the parameter

    Select Template>Web Attributes>Basic>Title in the toolbar, and write a parameter such as ${mytitle} in the toolbar, as shown in the following figure:

    1.png


    3. Effect preview

    Click Pagination Preview, add &mytitle=areasales after the url, you will find that the name of the report has been modified to areasales, as shown in the figure below:

    2.png

    IV. Example2

    1. Open the template

    Open the template: %FR_HOME%\webroot\WEB-INF\reportlets\GettingStartedEN.cpt


    2. Add loading end event

    Click Template>Web Attributes>Data Entry Settings, select Individually set for the template, and add Loading End event, as shown in the following figure:

    3.png

    The JS code is as follows:

    document.title = "Sales Comparison"//Custom title name


    3. Effect preview

    Save the template, click Data Entry Preview, the effect is shown in the figure below:

    4.png

    V. Example3

    Example of setting the title of a dashboard.

    Please refer to the completed template for details of designing report.


    1. Add post-initialization event

    Select body for the current widget, and add After Initializational event, as shown in the following figure:

    5.png

    The JS code is shown below:

    document.title = "Dashboard Title";


    2. Effect preview

    Effect as shown below:

    6.png

    VI. Download templates

    1. Example1

    Click to download: 

    Dynamic_title_example1.cpt


    2. Example2

    Click to download: 

    Dynamic_title_example2.cpt


    3. Example3

    Click to download: 

    Dynamic_title_example3.frm


    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