I’m trying to use a computed column in a Report for labelling features on a map.
The Report is based on a “Patrol Query” which generates a table and a map of patrol tracks.
I created the Computed Column by going to Reports > Outline > Data Sets > right click on the relevant Query > Edit > Computed Columns.
The Computed Column is a substring of the default style Patrol ID (in my case e.g. Atewa_000123), and the expression I used is row[“Patrol ID”].substring(9,12) (and I confirmed that this gives the desired result of the final three digits of the Patrol ID by viewing the query as a table and putting this expression in a blank field). Computed Column name is PatrolNum.
Going to the Map > MapLayers > Style, the Computed Column appears as expected in the drop down list of possible Label values.
But when I run the report I get a (long) error message basically saying “Could not find ‘PatrolNum’ in the FeatureType (smart:null)” and then lists the available options which are just the standard columns for a patrol query.
Is there another correct way to use a computed column as a label that I’m overlooking?
PS, can anyone explain why I had to use substring(from 9, to 12) in order to get the 10th, 11th and 12th characters of the patrol name? Substring(10,12) would seem more logical to me!