Inserting a geographic map to a web report
The Create Geographic Map Wizard appears.
To edit the business view, right-click the business view or any object in it and select Edit from the shortcut menu, then edit the business view in the Business View Editor as required.
To change the display name of the business view or an object, right-click the business view or the object and select Rename from the shortcut menu. Enter the new name in the name text box and click outside of the box to confirm the new name.
To delete an object, right-click it and select Delete from the shortcut menu.
For any group, you can specify the Select N condition for it. To do this:
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.
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 #.
Select a gradient color algorithm between two colors from the Gradient By drop-down list, which can be Auto, RGB or HSL.
Specify the opacity of the gradient color in the Opacity text box.
Click OK to apply the specified gradient color to the markers and return to the map wizard.
<install_root>\gisinfo\geocode
(click <New Formula...> to create one if the given formulas cannot meet your requirements). 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
.
To add a web behavior line, click , and if a web behavior is not required, click
to remove it.
Click or
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.
The web actions you can bind to the map markers and areas include Filter, Sort, Parameter, Property and SendMessage. For details about these web actions, refer to Applying Web Actions to a Label.
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.
The Create Geographic Map wizard appears.
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:
<install_root>\gisinfo
directory by default. If the XML file that you specify does not exist it will be created in the <install_root>\gisinfo
directory. The geographic data XML file is used to map the geographic latitude and longitude coordinates from Google Maps, OpenStreetMap or OpenCycleMap based on the location information specified for each group in the Marker tab. 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 import an XML file which contains predefined geographic data including latitude and longitude for the specific "nm" field. By default, the XML file is located in the <install_root>\gisinfo
directory, if not, the file will be copied to this directory after it is imported. When you publish the report from Designer you can specify the gisinfo files to publish to the Server from the Geographic Information tab.
If you do not publish the geographical information it will be created automatically when you first run the report.
Then specify the map type from the Map Type drop-down list, which can be Google Maps - Roadmap, Google Maps - Satellite, Google Maps - Terrain, OpenStreetMap - Standard, OpenCycleMap - Cycle Map or OpenCycleMap - Transport Map.Specify the location information of the markers by typing it in the Location Info text box directly or click and then 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. If the given formulas cannot meet your requirements, click <New Formula...> to create one.
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 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.
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.
Specify whether to show or hide the markers. You can simply select true or false from the Hide Markers drop-down list, or use a formula to control it.
If you have used the Insert menu tab command to insert the geographic map into a page report, and specified to insert it to position other than the report body or tabular cell, after clicking Finish in the wizard, you need to drag it to the destination using your mouse in order to insert the geographic map where you want it.
When a geographic map has been created, you can: