Advanced Report Functions

Article author
  • Updated


Query columns can have one or more formatters associated with them. This is not at all user friendly as it was always intended to have editor support. Usually you’ll only need one.

The most likely case where you might need more than one is where data is currently stored in the DB in json – in that case you might want to use the json query to extract something and then use a ‘FormatString’ on the result.

There are a list of ‘global’ lookups that can be applied to any column. There are also some column-specific lookups - Some of them are really specific, or just straight up hacks.

Global.FormatString lookup

    <Column name="FixedValue" source="Id">
      <Format lookup="@Tables.Global.FormatString">
        <ParameterSelect name="Template" source="@Parameters.Fixed Value" kind="Text" />
        <ParameterSelect name="Arg1" source="@Columns.Surname" kind="Object" />
The first parameter is required, and then you can have up to 3 ‘arguments’. A parameter source can be a parameter, or the raw selected value of other columns. The template value (usually setup as a string parameter) could look like:
Value of ‘this’ column: {0} Value of Arg1: {1} Etc.
Global.Query lookup
<Column name="Some field Value" source="@Tables.Some Table Value">
      <First />
        <Query>$[?(@.LabelCode == 260905004)].Value</Query>
Query raw Json using JsonPath syntax (newtonsoft flavour:                
Columns can be specified as ‘grouped’ by including them in the ‘order’ element, and specifying the ‘grouped’ attribute, e.g.
<?xml version="1.0" encoding="utf-16"?>
<Query xmlns:xsd="" xmlns:xsi="" table="Patient Demographics" xmlns="">
    <Column name="Id" source="Id">
      <Count />
    <Column name="Insurer Id" source="Insurer Id" />
    <Column name="Insurer Demographics Full Name" source="Insurer Demographics.Full Name">
      <First />
    <Ascending source="@Columns.Insurer Id" group="true" />
Once a column is grouped, all non-grouped columns require an aggregate. For grouped columns that already required an aggregate (1:n relations or table aliases) the grouping is performed on the aggregated result.