Successfully!

Error!

[General] JS Clicks Pagination Report to Drill Down and Return to Original Page

  • Last update:  2021-12-22
  • I. Overview

    1. Expected effect

    When using a report with pagination on the mobile terminal, after drilling into other reports, you often want to return to the original page to continue browsing. As shown below:

    1.gif


    2 Implementation ideas

    Add hyperlinks in both templates to realize the jump between each other.

    This document will introduce the implementation process.

    II. Example

    1. Create a new parent template

    1) Prepare data

    Create a new Template dataset, where the SQL statement of the ds1 dataset is: SELECT * FROM sales_Volume

    1.png

    2) Report design

    Design the table as shown below, and drag the fields into the corresponding cells:

    2.png

    Open Template>Repeat and Freeze Settings, set the repeat title behavior:line 1-2, and set the repeat end behavior: line 4.

    3.png

    Set one page to display 5 rows of data. SetCondition Formatting>Paging After Rowto cell B3, and the paging condition is Formula: seq()% 5 == 0

    4.png

    Add a serial number to the data. Add the formula in cell A3:&B3+"." to display the serial number.

    And set A3 Left Parent Cell to B3, and B3 Left Parent to None.

    5.png

    Set the Cell Format. SetData Settingof B3 to List.

    6.png

    Add the page number at the end of the page. Add page number display in F4 cell, add formula: "The" + $$page_number + "page"

    7.png

    Save this template and name the template: Mobile page jump test.


    2. Create a new sub-template

    Save Mobile page jump test as and rename it to: Mobile page jump test subpage.

    1) Modify the subpage dataset

    SELECT * FROM Sales_Volume

    where Region='${region}' and Salesperson='${sales}' and Product='${product}'

    8.png

    2) Add back button 

    Add a parameter to the G1 cell, the formula value is:$page, and setConditional Formatting value of the G1 cell to Column width 0, and the condition: None.

    9.png

    3) Add a hyperlink to the back button

    Add the text<Back to cell B1 of the subpage, add a js script hyperlink to cell B1, and add the parameterpage to the js script, the value is the formula: G1

    10.png

    The JS code is as follows:

    var url = encodeURI("${servletURL}?viewlet=/Mobile page jump test.cpt&page="+page);
    FR.doHyperlinkByGet({url:url,title:'Mobile page jump test.cpt',target:'_self'})                                                                    


    3 Parent page settings

    1) Add hyperlink

    Return to theMobile page jump test.cptreport, and add a Web Report hyperlink to cell C3. The specific settings are as shown in the figure below:

    11.png

    2 ) Add loading end event

    Set Template>Template web Attributes and add Loading End event in thePagintion Preview , as shown in the following figure:

    12.png

    The JS code is as follows:

    var pa='${=$page}'
    if(pa){
    contentPane.gotoPage(parseInt(pa))}//Jump to the specified page                                                                                

    III. View the effect

    Please refer toSection I of this document for mobile display effect.

    IV. Completed template

    The completed template can be found in:

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\JS\Mobile_page_jump_test.cpt

    %FR_HOME%\\webapps\webroot\WEB-INF\reportlets\doc-EN\JS\Mobile_page_jump_test_subpage.cpt

    Mobile_page_jump_test.cpt

    Mobile_page_jump_test_subpage.cpt

    Attachment List


    Theme: Fine Mobile
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback