Variables

Report Builder can use a number of substitution variables in widgets. These allow you to easily embed data values 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 in the edit mode of a text widget (double-click on the text widget to open the editor), there are three buttons allowing you to add variables. The first one is labelled Feature Name. It inserts the variable #FNAME (see below) which gets replaced with the name of the selected feature.

The second button labelled Indicator Name opens a drop down list with all indicators which are available for this widget. If you select one of them, Report Builder inserts a variable #IINAME{<number>} or #INAME{<datastore-id>} (see below). The Value button inserts the corresponding variable to show the value for that indicator for the current feature.

Normally you will enter these variables using the drop-down menus. However, in some cases you will need more control – 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)
Indicators
#IINAME{x} Indicator instance name from feature service or CSV, x = indicator/instance index – which will be column index for the 1st data set otherwise it will be offset by number of columns in first data set(s) + column index. Example: #IINAME(1) will display the indicator name from the first column of the dataset.
#INAME{datastore:Ixxx} Indicator name from data store, 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.
#IVALUE{x} Indicator value from feature service or CSV, x = indicator index – (see above).
#ILVALUE{datastore:Ixxx} Indicator value from data store, Ixxx = the indicator’s unique ID – (see above)
#ILVALUE{datastore:Ixxx,Cy} Comparison value for indicator value from data store, 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{datastore:Ixxx,C:yyy} Comparison value for indicator value from data store, 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).
#CVALUE{x,y} Comparison value where x = indicator index (see above) and y = comparison index
#CVALUEBYID{x,y} Comparison value where x = indicator index (see above) and y = comparison ID (see above)
#IDATE{x} Date value – non datastore; x = indicator instance index – (see above)
#ILDATE{datastore:Ixxx} Datastore latest date variant; Ixxx = the indicator’s unique ID – (see above)

Table Widgets

Table widgets have some special variants of these substitution variables for use in table cell rules. These can be used to compare values within the same indicator. So, if you use these values for table cell rules, the indicator index will always be 1 (one) which means the indicator currently being inserted into the table. That will mean either comparing values within a column, or within a row, dependning on your table layout.

#CVALUE{x} as above but x is the comparison index, indicator index is assumed (see other email)
#CVALUEBYID{xxx} as above but xxx is the comparison ID, indicator index is assumed (see other email

Advanced

Many other widgets can use the substitution variables listed above. Details are shown in the table below. Most of these widgets do not have a UI that helps you insert these variables, you must type them 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.