Report Builder can use a number of substitution variables in widgets. These allow you to add dynamic text into the widget, or, for rule-based widgets, to test data values and show different text or styles depending on the outcome.

Text Widgets

When you are editing a Text widget, there are two buttons that allow you to add variables. The first one is Insert feature value. It is used to insert the variables #FNAMES or #FIDS which get replaced with the name or ID of the selected feature. The second button is Insert indicator value. When clicked it will display a drop down list with all indicators that are available for this widget. If you select one of them, Report Builder inserts the variable #IVALUE which gets replaced with the value for the corresponding indicator for the selected feature.

You can also add variables by manually typing them in as text. The tables below summarise the available variables for text widgets and what they do.

Features
#FNAMES{, } Displays area name(s), separated by the character in the brackets, e.g. “, “. In most cases this will give a single area name i.e. the area being reported on.  However, if you used this variable in say the title of a table widget and had ‘show all areas’ selected in the data tab then all area names would be displayed.  Note: in a text widget you can only display the area being reported on.
#FNAME{x} Area name at index x (x is optional, you can use #FNAME if followed with a space, with #FNAME{1} being most useful). If used in a widget where you were displaying data for all areas you could pick out say the 5th area name using #FNAME{5}
#FID{x} Area ID at index x (x is optional, you can use #FID if followed with a space, #FID{1} being most useful). So, for a county-level report, #FID{1} would give you E06000052 if you were viewing the report for Cornwall.
#CFNAME{x} Comparison Area Name at index x (see below)
Today’s date
#TODAY{yyyy} Displays today’s date as a four-digit year format for example 2022. Can be used to specify indicator values for the current date where the latest available date is larger than the current date (e.g. projections).
#TODAY{mm} Displays today’s date as a two-digit month format for example 02 (for February). Can be used to specify indicator values for the current date where the latest available date is larger than the current date (e.g. projections).
#TODAY{mmm} Displays today’s date as a three-digit month format for example Feb (for February). Can be used to specify indicator values for the current date where the latest available date is larger than the current date (e.g. projections).
Indicators
Data Catalog Indicators
#INAME{catalog:Ixxx} Indicator name from data catalog, Ixxx = the indicator’s unique ID –  you can either get this by using the drop-down menu or by looking at the metadata for the indicator.
#ILVALUE{catalog:Ixxx} Indicator value for the latest date from data catalog, Ixxx = the indicator’s unique ID – (see above)
#ILVALUE{catalog:Ixxx,Cy} Comparison value for the latest date of the indicator from data catalog, the indicator’s unique ID – (see above), Cy = comparison index (1 being the first comparator, which is normally one geographical level above, Wards > District for example).
#ILVALUE{catalog:Ixxx,C:yyy} Comparison value for the latest date of the indicator from data catalog, Ixxx = the indicator’s unique ID – (see above), C:yyy = area code of comparison area (for example, C:E92000001 is England, C:E06000052 is Cornwall).
#ILDATE{catalog:Ixxx} Data catalog latest date variant; Ixxx = the indicator’s unique ID – (see above)
#IVALUE{catalog:Ixxx,y,zzzz} Indicator value for a specific date from data catalog, Ixxx = the indicator’s unique ID – (see above), y = feature index – in most cases 1, zzzz = the date as recorded in the data catalog (for example 2020). The date argument can be replaced by one of the variables for Today’s date providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date).
#IVALUE{catalog:Ixxx,Cy,zzzz} Comparison value for a specific date of the indicator from data catalog, the indicator’s unique ID – (see above), Cy = comparison index (1 being the first comparator, which is normally one geographical level above, Wards > District for example), zzzz = the date as recorded in the data catalog (for example 2020). The date argument can be replaced by one of the variables for Today’s date providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date).
#IVALUE{catalog:Ixxx,C:yyy,zzzz} Comparison value for a specific date of the indicator from data catalog, Ixxx = the indicator’s unique ID – (see above), C:yyy = area code of comparison area (for example, C:E92000001 is England, C:E06000052 is Cornwall), zzzz = the date as recorded in the data catalog (for example 2020). The date argument can be replaced by one of the variables for Today’s date providing the date in the data catalog matches that format (useful for projections where the latest available date is larger than the current date).
CSV File or Feature Service Indicators
#IVALUE{x} Indicator value from feature service or CSV, x = indicator/instance field name (column header). Example: #IVALUE{TOTAL_POP} will display the indicator value from the a field/column named TOTAL_POP in the dataset.
#IVALUE{x,C:y} Comparison value for indicator value from CSV data sources; x = field name, y = comparison feature ID.
#IINAME{x} Indicator instance name from feature service or CSV, x = indicator/instance field name (column header).
#IDATE{x} Date value – non data catalog; x = indicator instance field name– (see above)

Note: in version 1 of Report Builder variables using CSV or similar data used {index} rather than {field_name} to identify data values. This option is still available but it is strongly recommended that you use the {field_name} pattern instead as using {index} can give unpredictable results when data sources are updated. See also the auto-migration notes.

Other Widgets

Other widgets can make use of variables in their settings. Examples are shown in the table below. For most of these widgets you must type the variables in manually.

Image widget You can use substitution variables in the URL to your image. This can give a quick way of embedding images that are specific to your report, for example:

http://myserver/images/areas/#FNAME{1}.png

http://myserver/images/maps/os_#FID{1}.png

Text Box widget All of the substitution variables above can be used in the Title setting as well as in the message text.
Web Map widget All of the substitution variables above can be used in the Title setting.
Bar Chart and Line Chart widget If you wish to add confidence limit values to the tooltip you can use the variables #YMIN and #YMAX.

 

Number Format

For indicator values, you can specify the number format that you would like the value to be displayed with if you wish. This will take precedence over the number format that is set at the level of the widget itself (in the widget settings).

In your substitution variable, you simply need to add ;NF: followed by the desired number format.

For example, if inserting an indicator value from a data catalog, and you wish to always display this with two decimal places:

#ILVALUE{catalog:Ixxx;NF:###,###.00}

Or if inserting an indicator value from a CSV file or feature service, it would look like this:

#ILVALUE{catalog:x;NF:###,###.00}