Hyperlink pass web page parameters

  • Last update:  2021-04-23
  • I. Description

    When creating a template, you may sometimes need to pass the parameters or some values in the report to your own web page for some processing. At this time, how do you pass the values in the report to the web page?

    1.png


    II. Idea

    Go to the webpage by setting the hyperlink and set the parameters, and then get the parameters through request.getParameter("parameter name in the hyperlink") in the webpage.

    III. Example

    1. Template preparation

    New dataset ds1: SELECT * FROM Shipper

    Design the template style as shown below:

    2.png


    The next thing to do is to set the value passed by the hyperlink and get the value set in the web page.


    2. Hyperlink setting

    Right-click the cell D2 where the modification is located, and click the hyperlink to add a web link. The specific settings are as follows:

    3.png

    Please refer to the completed template: 

    %FR_HOME%\WebReport\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\Hyperlink_pass_web_parameter.cpt


    3. Web page to get parameter settings

    Get the passed parameters

    <%  
    String ID = request.getParameter("ID");  
    String TELEPHONE = request.getParameter("TELEPHONE");  
    %> 

    The complete code:

    <%@ page language="java" pageEncoding="GBK"%>  
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
    <%  
       String ID = request.getParameter("ID");  
       String TELEPHONE =request.getParameter("TELEPHONE");  
    %>  
    <html>  
      <head>  
        <title>Modify basic parameter</title>  
      </head>  
      <body>  
        <table  width="350" border="0" cellspacing="1" cellpadding="5px">  
          <tr>  
            <th width="130">ShipperID:</th><td width="208"><input type="text" id="ID" value="<%=ID %>" disabled/></td>  
          </tr>  
          <tr>  
          <th>Telephone number:</th><td><input type="text" id="TELEPHONE" value="<%=TELEPHONE %>"/></td>  
          </tr>  
       </table>  
      </body>  
    </html>

    Name it update1.jsp and save it in the %TOMCAT_HOME%\webroot directory.


    4. Effect preview

    Start the Tomcat server, preview the template, and click the hyperlink to see that the corresponding value is transferred to the web page, as shown in the above rendering.

    IV. Template download

    Please refer to the completed template: %FR_HOME%\WebReport\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\Hyperlink_pass_web_parameter.cpt

    Click to download: 

    Hyperlink_pass_web_parameter.cpt



    Attachment List


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