Successfully!

Error!

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

    Doc Feedback