Customize Grid Columns

Custom columns are display customizations that can be made to each column of data returned in any given dataset. You can combine any number of charts (see JSON Chart Objects) and custom columns with as many datasets as your report returns.

JSON CustomColumn Objects

The following table describes the fields used for custom columns:

Field Name

DATA TYPE

Description

FieldName*

String

The name of the field as returned in the dataset. In order to apply any customization, this value must match a field from the dataset.

Caption

String

Specify a column heading to use instead of the field name.

If this is not specified, the field name will be used with spaces added between camel-cased words.

Aggregate

String

All numerical fields in your dataset default to using a summation aggregate.

To add aggregation to additional fields or modify the way the aggregation occurs, you can use this setting to alter the default behavior.

Available values are:

  • count

  • sum

  • min

  • max

  • none – disables aggregation for this field.

  • other – anything specified here will appear in the aggregate row for this column. For example,  Total” or “Most Recent Date.

FormatType

String

This field allows the default display behavior of the specified field to be overridden. Available options are:

  • string

  • Number

  • FileSize – See the following paragraph and field for details.

  • Date

The FileSize type instructs the report interface to try and add the unit of the file size to the end of the text, such as 500 kb or 20.3 mb. It always rounds to the highest unit possible without dropping below 1. Thus, if your field returns 1600000 bytes, it will appear as “1.52 mb.”

FileSizeBaseUnit

String

The FileSizeBaseUnit field is only used if you have specified a FormatType of FileSize. By default, the report interface assumes that the field is a number in bytes. To change this if the unit from your report differs, use one of the following options:

  • b

  • kb

  • mb

  • gb

  • tb

  • pb

* Indicates a required field.

Example

The following example presents a DisplayMetadata field that modifies the behavior of three columns:

 

[

  {

    "CustomColumns":

      {

        "FieldName": "ProductionName",

        "Caption": "Name of Production",

        "Aggregate": "Last Production:"

      },

      {

        "FieldName": "FileSize",

        "FormatType": "fileSize",

        "FileSizeBaseUnit": "b"

      }

      {

        "FieldName": "ProductionDate",

        "Aggregate": "max"

      }

    ]

  }

]