Dynamically Display the Map Area According to the Parameters

  • Last update:  2024-03-06
  • I. Overview

    1. Problem description

    The parent template displays the national map, and the child template dynamically displays the province map corresponding to the region according to the regional parameters passed by the parent template. Results as shown below:

    1.gif


    2. Solutions

    Through Special Effect>Interaction>Hyperlink, the map area can be displayed dynamically.

    II. Example

    1. New sub-template

    1) Data preparation

    Create a New General Report, Renamed to: mapson.cpt,create a new dataset ds1, the database query statement is: select * from MapEN where pid = '${area}'. As shown below:

    1.png

    2) Insert chart

    Merge a piece of area cells, right-click cell A1, select Cell Element>Insert Chart>Map>Area Map, as shown in the figure below:

    2.png

    3) Data binding

    Bind the chart data, as shown in the following figure:

    3.png

    4) Style designAdd template parameters

    Click Template>Template Parameteron the menu bar of the designer, and add a new template parameter MapBoundary whose value is the formula: "geographic/world/China/"+$area, as shown in the figure below:

    4.png

    Note: The area parameter is the parameter passed by the hyperlink in the parent template to the child template.

    Set the map boundary

    Select the map and set the map boundary as the Template Parameters-MapBoundary, as shown in the figure below:

    5.png


    2. Add hyperlink to parent template

    1) Open the built-in template of the designer:%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Advanced\Chart\NewMap\map.cpt, As the parent template.

    2) Parent templateSpecial Effects>Interactive AttributesNext, add a hyperlink of the network report type, link to the sub-template, and set the transfer parameter to area, whose value is the area name, as shown in the following figure:

    6.png


    3. Effect preview

    Save the template, select the template mapFather.cpt, click Pagination Rreview, the effect is as shown in the figure below:

    1.gif


    III. Template download

    The completed template can be found in:

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\mapFather.cpt

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\mapSon.cpt

    Click to download the template:

    mapFather.cpt

    mapSon.cpt


    Attachment List


    Theme: Chart
    • 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