パラメータで地図エリアを自動調整

  • 作成者:ayuan0625
  • 編集回数:6次
  • 最終更新:FRInternational 于 2021-03-25
  • 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. Data preparation

    Create a New Normal Report, create a new data set 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 design

    1) Add template parameters

    Open the template mapSon.cpt and add the template parameter: MapBoundary, the parameter value uses 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.

    2) 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


    5. Special effects design

    1)Open the template%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Advanced\Chart\NewMap\map.cpt,select cell A1, select cell element, select Special Effect>Interaction>Hyperlink, select Hyperlink-Web Report, select the newly created mapSon.cpt, add the parameter area, and select the AREA_NAME for the parameter value, as shown in the figure below:

    6.png


    6. Effect preview

    1) PC

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

    2.gif

    2) Mobile

    3.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: FineReport チャート
    既に最初
    既に最後
    • Helpful
    • Not helpful
    • Only read