BackPrevious Page Next PageNext

Inserting Geographic Maps in a Report

Creating geographic maps in a web report/library component

Creating geographic maps in a page report

With the geographic map wizard, it is easy to create geographic maps in a report, however the wizard varies with the report type: web report/library component and page report.

If you want to use geographic maps in a page report, you need to make sure the page report is created using query resources. Geographic map is not supported in page reports that are based on business views.

A geographic map can be inserted into the report areas listed in Component placement. When it is inserted into a banded object, you can use a data container link to define the relationship between the geographic map and its parent.

Creating geographic maps in a web report/library component

  1. Position the mouse pointer at the destination where you want to insert the geographic map.
  2. Do either of the following:

    The Create Geographic Map Wizard appears, which contains a set of screens for helping you define a geographic map easily. You can use the Back and Next buttons or click the screen name on the screen navigation bar to switch between the screens.

  3. In the Data screen, select a business view in the current catalog using which to create the geographic map.

    Create Geological Map wizard - Data

  4. In the Display screen, specify the map type from the Map Type drop-down list, it could be one of the following: OpenStreetMap - Standard, OpenCycleMap - Cycle Map, OpenCycleMap - Transport Map, Google Maps - Roadmap, Google Maps - Satellite and Google Maps - Terrain.

    Create Geological Map wizard - Display

  5. The Resources box lists all the group objects Group icon and aggregation objects Aggregation cion in the specified business view, as well as the dynamic formulas used as Group Dynamic Formula as Group icon and dynamic formulas used as Aggregation Dynamic Formula as Aggregation icon for the business view in the current report. You can use them to create the geographic map.

    In the Resources box, you can also further edit the business view and the objects as follows:

  6. In the Drill Path box specify how data in the geographic map will be grouped.

    To add a group, select a group object or dynamic formulas used as Group in the Resources box and click Add button or drag and drop it to the selected node in the Drill Path box; to remove an unwanted group, select it and click Remove button or drag and drop it out of the Drill Path box. Make use of Move Up button and Move Down button above the Drill Path box to adjust the group levels. For any group, you can specify a Select N condition for it if needed (for details about the feature, see Specifying Select N conditions for the groups).

  7. To enable setting the marker and area properties for all groups, check the Enable Marker and Enable Area checkboxes (one of the two checkboxes must be checked at least and Enable Marker is checked by default).
  8. Select each group level from the Drill Path box and specify its marker properties.
    1. Specify the shape of the markers in any of the following ways.
      • If you want to use a shape as the markers, click Shape button next to the Shape By box and select a shape from the shape list, then click outside of the shape list to apply the selected shape.
      • If you want to use an image to be the shape of the markers, click Shape button, then check the checkbox ahead of the Advanced option in the shape list. A default image will then be applied as the shape of the markers. If you want to customize the image, after checking the checkbox, click Advanced to open the Advanced dialog to specify the image.

        Shape Advanced dialog

        1. Uncheck the Default Icon option.
        2. Input the URL for a web image in the Image text box, or click the Browse button to specify a local image.
        3. Specify the width and height of the image.
        4. If you want to change the width and height for the image at the same time in a certain proportion, check Constrain Proportion.
        5. If the map is of any Google Maps type, you can further specify a shadow image for the markers.
        6. When done, click OK to apply the images and return to the map wizard.
      • If you want to control the shapes of the markers by values, select the group object that represents the currently selected group level, or a group object of a higher level than the current level in the Drill Path box, or an aggregation object from the Resources box and click Add button or drag and drop it to the Shape By text box, then click Shape button to open the Edit Shapes dialog to edit the shapes.

        Edit Shapes dialog

        1. From the shape pattern drop-down list, select the required pattern. A preview of the shapes in the selected pattern will be displayed in the box below.
        2. The field values with the shapes in the selected pattern are listed in the Data Items box. You can change the shape for each value by selecting it and then clicking a shape in the preview box. Note that if an aggregation field has been added to control the shapes, the Data Items box will be blank. You cannot customize the shapes and the default shapes in the selected pattern will be applied at runtime.
        3. Click OK to apply the specified shapes to the markers and return to the map wizard.
    2. Specify the color of the markers in any of the following ways.
      • Click Color button next to the Color By text box and select a color from the color palette or click More Colors on the color palette to open the Pick a Color dialog, with which you can set a full range of color.
      • If you want to control the colors of the markers by group values, select the group object that represents the currently selected group level, or a group object of a higher level than the current level in the Drill Path box from the Resources box and click Add button or drag and drop it to the Shape By text box. You can add more than one group objects and when several group objects are added, you can adjust their display order by dragging and dropping them in the text box. Click Color button to open the Edit Color dialog to edit the colors.

        Edit Color dialog

        1. From the color pattern drop-down list, select the required pattern. A preview of the colors in the selected pattern will be displayed in the box below.
        2. The field values with the colors in the selected pattern are listed in the Data Items box. You can change the color for each value by selecting it and then clicking a color in the preview box.
        3. Specify the opacity of the colors in the Opacity text box.
        4. Click OK to apply the specified colors to the markers and return to the map wizard.
      • If you want to control the colors of the markers by aggregation values, select an aggregation object from the Resources box and click Add button to add it to the Color By text box, then click Color button to open the Edit Gradient Color dialog to edit the colors.

        Edit Gradient Color dialog

        1. Select a gradient color from the color drop-down list. A preview of the gradient color will be displayed on the color bar.
        2. You can further customize the gradient start color, middle color and end color by clicking the corresponding triangle below the color bar to select a color from the color palette or click More Colors on the color palette to access the Pick a Color dialog in which you can select a color within a wider range. The middle and start colors can be deleted, however, if the start color is deleted, a default start color will still be applied automatically. To add the start and middle colors back, click + and specify the color on the color palette. After you change a default gradient color, it will be saved as a customized gradient color and you will find the name changed to Customize in the color drop-down list.
        3. Click Reversed if you want to reverse the direction of the gradient color.
        4. Check the Middle Value checkbox and specify the middle data value mapping to the middle color, which takes effect only when the middle color is not null. Then the gradient color will change from the start color to the middle color, and then change from the middle color to the end color. You can also set the middle value to 0 and check the Auto Expand Start/End value checkbox, in which case, the negative and positive values of the maximum absolute value will be used to map to the start color and end color, and 0 will always be in the center of the data range.

        5. Click the color image button beside Color of Null Values to specify a color for null values on the color palette, or click More Colors on the color palette to access the Pick a Color dialog in which you can select a color within a wider range, or you can input the hexadecimal value of a color directly in the text box after #.

        6. Select a gradient color algorithm between two colors from the Gradient By drop-down list, which can be Auto, RGB or HSL.

        7. Specify the opacity of the gradient color in the Opacity text box.

        8. Click OK to apply the specified gradient color to the markers and return to the map wizard.

    3. Select an aggregation object from the Resources box and click Add button or drag and drop it to the Size By text box if you want to control the size of the markers by aggregation values, then click Size button next to the Size By text box to specify the zoom percentage based on the default size. To restore the default size, click Reset.
    4. Add objects to the Label By text box to specify the labels shown above the markers by selecting them one by one and clicking Add button or by dragging and dropping them to the box, then click Label button next to the Label By text box to set the font properties of the labels. When more than one object is added, you can adjust their display order by dragging and dropping them in the text box.
    5. Type the tip information which displays when you hover the mouse on the markers at runtime in the Marker Tip text box directly, or click Formula button and then select a field or use a formula to control the tip.
  9. Select each group level from the Drill Path box and specify its area properties.
    1. Specifies the colors that are used to fill the areas in the Fill By text box using the same way for specifying the marker colors.
    2. Add objects to the Label By text box to specify the labels shown above the areas by selecting them one by one and clicking Add button or by dragging and dropping them to the box, then click Label button next to the Label By text box to set the font properties of the labels. When more than one object is added, you can adjust their display order by dragging and dropping them in the text box.
    3. Type the tip information which displays when you hover the mouse on the areas at runtime in the Area Tip text box directly, or click Formula button and then select a field or formula from the drop-down list to control the tip. If the given formulas cannot meet your requirements, click <New Formula...> to create one.
  10. Select each group level from the Drill Path box and specify the location information of the markers and areas of the group by typing it in the Location Info text box directly or click Formula button and then select a field or formula from the drop-down list which contains the values matching the folder names in <install_root>\gisinfo\geocode. For example you may group by Country and State. For State, you would want to use a formula fStateCountry that concatenates state and country so Google Maps, OpenStreetMap or OpenCycleMap knows which state to use such as "New York, USA" or "California, USA".

    JReport also supports using longitudes and latitudes as locations of the markers, however before you can do this, you need to change the value of the className option for geocoding to com.jinfonet.web.modules.map.service.DirectGeoCoder in the file config.json which is stored in <install_root>\gisinfo for both JReport Designer and JReport Server before starting them, then in JReport Designer create a formula as follows and select it from the Location Info drop-down list: @LongitudeValue + “,” + @LatitudeValue.

  11. If you are creating a geographic map in a library component, you can bind web behaviors to the markers and areas of each group level.
    1. Select a group in the Drill Path box, then click the Web Behaviors button. The Web Behaviors dialog appears.

      Web Behaviors dialog

    2. In the Marker tab, select a trigger event from the drop-down list in the Events column, then click in the Actions column and click Choose button that appears in the text box. In the Web Action List dialog, bind a web action to the markers the same as you do to a label in the library component, which will be triggered when the specified event occurs on the markers. The web actions you can bind include Parameter, Filter, Sort, Change Property and Send Message.
    3. To add more web behaviors, click Add button and define them as required; if a web behavior is not required, select it and click Remove button.
    4. Click Move Up button or Move Down button to adjust the order of the behaviors, then at runtime when an event that has been bound with more than one action happens, the upper action will be triggered first.
    5. Switch to the Area tab to bind web behaviors to the areas of the selected group in the same way.
    6. Click OK to apply the web behaviors to the group and return to the map wizard.
    7. Select other groups in the Drill Path box and bind web behaviors to their markers and areas if needed.
  12. In the Filter screen, apply a filter to reduce the data displayed in the geographic map. You can select a predefined filter of the specified business view from the Filter drop-down list to apply, or select User Defined in the list to define a new filter as required.

    Create Geological Map wizard - Filter

  13. Click Finish to insert the geographic map.

Creating a geographic map in a page report

  1. Position the mouse pointer at the destination where you want to insert the geographic map.
  2. Do either of the following:

    The Create Geographic Map wizard appears, which contains a set of screens for helping you define a geographic map easily. You can use the Back and Next buttons or click the screen name on the screen navigation bar to switch between the screens.

  3. In the Data screen, select the data resource in the current catalog using which to create the geographic map.

    Create Gepgraphic Map wizard - Data

    If the predefined data resources are not what you want, you can click the first item in the corresponding resource node to create one. When a query is selected, click the Edit button to modify the query if required. Then a new dataset based on the selected data resource is created in the page report.

    If you want to use an existing dataset in the current page report to create the geographic map, click the More Options button and then:

  4. In the Group screen, specify the criteria for grouping data in the geographic map using the same way for grouping data in a table.

    Create Gepgraphic Map wizard - Group

  5. In the Filter screen, add filter conditions on the group-by fields that have been added to the geographic map to reduce the data. For how to define a filter, click here.

    Create Gepgraphic Map wizard - Filter

  6. In the Layout screen, specify the geographic data for the geographic map and the map type. JReport supports the following map types: Google Maps - Roadmap, Google Maps - Satellite, Google Maps - Terrain, OpenStreetMap - Standard, OpenCycleMap - Cycle Map or OpenCycleMap - Transport Map.

    Create Gepgraphic Map wizard - Layout

    By default, GeoData.xml in the <install_root>\gisinfo directory is used for mapping the geographic latitude and longitude coordinates from Google Maps, OpenStreetMap or OpenCycleMap based on the location information specified for each group in the Marker screen. When the location information key string of a group value matches the "nm" field in the XML file, you will get the related latitude and longitude value for this group value. You can also click Browse to import an XML file which contains predefined geographic data including latitude and longitude for the specific "nm" field and the file will be copied to <install_root>\gisinfo after it is imported if it does not exist in the directory. When you publish the report from JReport Designer to JReport Server you can specify the gisinfo files you want to publish. If you do not publish the geographical information it will be created automatically when you first run the report.

  7. In the Marker screen, specify the marker properties for each group level.

    Create Gepgraphic Map wizard - Marker

    1. Select a group from the Geographic Map box.
    2. In the Location Info text box, specify the location information of the group markers. You can type in the location directly in the text box or click Formula button and select a field or formula from the drop-down list which contains the values matching the "nm" field in the geographic data XML file. The values seen in this Location Info field will be used to create the "nm" field values when the XML does not already exist.
    3. Specify the tip information which displays when you hover the mouse on the markers at runtime by typing it in the Marker Tip text box directly, or click Formula button and then select a field or formula from the drop-down list to control the tip.
    4. To customize the image for the markers, uncheck the Default Icon option, then specify the image, the shadow image (only available for Google Maps types), and their width and height respectively. If you want to change the width and height for the image/shadow image at the same time in a certain proportion, check Constrain Proportion.
    5. From the Hide Markers drop-down list, specify whether to show or hide the markers. You can also click Formula button to select a formula that returns a Boolean value to control this.
    6. Select other groups in the Geographic Map box and specify their marker properties in the same way.
  8. Click Finish to insert the geographic map.

    If you have used the menu command to insert the geographic map and selected a panel in a banded object as the its destination, after finishing the wizard, you need to click the mouse button in the destination once again in order to insert the geographic map there.

BackPrevious Page Next PageNext