BIRT Map Updates for Weave 2.4
As part of the update in Weave 2.4 BIRT has been updated from version 2.2.1 to 2.6.1, which in itself provides a number of enhancements and bug fixes, but also allowed for some changes to the way that the mapping components works.
Setting map size
You can now set the size of the map component via the properties editor.
Changed the wording for the location types
The names of the options for determining the centre of the map have been changed to hopefully make it more obvious what they're doing
Client View Extent is was previously called Original, and matches the center of the map to be the same as what the user was viewing.
Selection Extent was previously called Selection, and matched the center of the map to be the center of the current selection.
Specific Extent was previously called Specific, and allows you to enter an extent directly (not that if this is chosen the scale type will be ignored).
Changed the wording for the scale types and added a new one
The names of the options for determining the scale of the map have been changed to hopefully make it more obvious what they're doing
Client View Extent was previously called Original, and matches the scale of the map to include at least the current map content that the user was viewing.
Client View Scale is new and matches the map scale to what the user was viewing.
Selection Extent was previously called Selection, and matches the scale of the map to include the currently selected features.
Specific Scale was previously called Specific, and allows you to enter a scale value directly, either as a scale or as a formula.
Client View Scale was introduced to make it easier to create a map at the same scale as the user was viewing, as opposed to Client View Extent, which tries to match the extent that the user was viewing which may result in a different map scale.
Improved support for optional parameters when setting the scale
Previously you could add a report parameter to allow the user to choose the map scale, and then use the parameter value with a Specific Scale scale type to set the map scale explicitly, but this required the user to always enter a scale value (and forced you to ensure the scale parameter was set as "required").
It's now possible to have the scale report parameter not be a required parameter and have the map fall back to either Client View Extent or Client View Scale if the user doesn't choose a value.
Assuming that you've crated an optional report parameter called 'scale'
you can use the following formula
if ( params["scale"].value ) params["scale"] else null
to use the current view extent, and the following formula
if ( params["scale"].value ) params["scale"] else params["client.scale"]
to use the current view scale ("client.scale" is an auto-generated parameter created by Weave to represent the current map scale)
This can be done by using a Specific Scale and hitting the formula button
The pasting the formula into the formula builder that appears
Displaying generated map scale
As of version 2.1.0 of the com.cohga.server.report.birt.map bundle (Weave 2.4.3) a new parameter is available, after a map component is generated, that provides the value of the scale that the map was actually generated at. The parameter will be named scale
, if the map doesn't have a name, or <name>.scale
if the map does have a name.
The numeric value is directly available as params["scale"]
(or params["<name>.scale"]
) or a formatted string value available using params["scale"].displayText
(or params["<name>.scale"].displayText
).