Hyperlink to different URL by content

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

    When a field in the table saves a web page address, how to click on a cell to pop up a dialog box to display the web page, as shown in Figure 1:

    1.gif

    The URL format of the hyperlink is fixed, but some of the values are different. How to open the corresponding page by clicking the cell to replace the corresponding URL value? Figure 2:

    2.gif

    II. Example1

    Prepare the dataset Embedded1 as follows:

    3.png

    Drag the dataset field into the cell:

    4.png

    Select cells A1 and B1, right-click and select the Hyperlink, add JavaScript, add two parameters title and url in the parameter bar, the parameter values are formula A1, B1, and add the following JavaScript code:

    5.png

    var iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' scrolling='yes' frameborder='0'>");   
    iframe.attr("src", url);
    var o = {  
    width : 960, 
    height: 550 
    };  
    FR.showDialog(title, o.width, o.height, iframe,o);

    Save the template and click on the pagination preview to see the above effect.

    Provide a more concise method:

    Set the super link directly in cell B1 and add parameter a:

    6.png

    Pass the current URL and use window.open to open the URL as a new page.

    III. Example2

    Another situation: The URL format of the hyperlink is uniform, but a certain value is different. Passing the parameters directly behind the URL is not easy to achieve.

    As shown in the figure: the format of [URL] is the same, but the value of [Homepage ID] is different.

    7.png

    1) Prepare the dataset:

    8.png

    2) Select A2, right-click and select [Hyperlink], add [JavaScript], add the parameter [p_name] in the parameter column, the parameter value is the formula [B2], and add the following JavaScript code:

    9.png

    window.open('https://help.fanruan.com/finereport-en10.0/doc-view-' + p_name + '.html', '_blank');

    Save the template and click on the pagination preview to see the above effect.

    Note: URL format-http://www.baidu.com; don’t miss http://

    4. Template download

    1. Example1

    Click to download: 

    Hyperlink_by_content-example1.cpt


    2. Example2

    Click to download: 

    Hyperlink_by_content-example2.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