DisplayMetadata Field

The DisplayMetadata Field is a string field comprised of one JSON array with strict requirements.

 

Note: This topic assumes that you understand the rules and structure of JSON. It is strongly recommended that you use a JSON validator to ensure that the system works without errors. If you are unfamiliar with JSON, it is recommended that you learn about it elsewhere (for example, see http://www.json.org/ before you continue. This topic is beyond the scope of this document.

 

Important: All of the following JSON details are case-sensitive. To avoid errors, ensure that you provide both the field names, as well as the field values, exactly as they are specified in this document.

 

DisplayMetadata JSON Objects

The DisplayMetadata is a JSON Array comprised of one object for each data set that is returned by your custom report stored procedure. The following table describes the schema for each configuration object.

Field NAME

DATA TYPE

Description

Header

String

By default, the header for your dataset will simply be "Dataset X", where X is the numbered ordering of your datasets.

To override this behavior, use this field to add a custom header to your dataset, such as "Archives" or "Total Counts".

AutoAggregate

Boolean

This is a true/false field that determines whether or not Enterprise Reports will try to automatically aggregate any numerical fields within this dataset.

Charts

JSONArray

This additional JSON field allows the creation of charts for this dataset. Because it is an array, you can provide multiple charts for a single dataset.

This field is completely optional; additional details are provided in JSON Chart Objects below.

CustomColumns

JSONArray

This additional JSON field allows the manipulation of individual columns for this dataset. Because it is an array, you can provide multiple columns for a single dataset.

This field is completely optional; see Customize Grid Columns for more information.

JSON Chart Objects

Multiple chart types are available, as described in the following table; the configuration for all of them is similar. Hints for handling different chart types are also presented in the following table. See the example below for a description of how to define a single chart and how it fits in the DisplayMetadata JSON.

You can combine any number of charts and custom columns (see Customize Grid Columns) with as many datasets as your report returns.

Field NAME

DATA TYPE

Description

Type

String

Specify the type of chart. The following chart types are available. A Bar Chart is used if this value is omitted.

  • pie

  • doughnut

  • bar

  • horizontal Bar

  • line

XAxisField*

String

Specify the field that contains the names of items being reported on. The values of this field are used on the X Axis of a bar chart, or the sections of a pie or doughnut chart.

This field is typically the field used in the “group by” clause of the SQL statement used to generate the report data.

For example, specify “ProductionName” for following SQL statement: 

SELECT ProductionName, sum(DocumentCount) as DocumentCount, sum(Pages) as PageCount, sum(NativeCount) as NativeCount FROM DocumentList GROUP BY ProductionName.

 

YAxisFields*

Array of strings

Specify the field(s) used as data points in the chart. For bar, horizontal Bar, or line charts, multiple datapoints can be displayed; however pie or doughnut charts display best with only one value specified here.

For example, specify [PageCount”] or [“PageCount”, “NativeCount”, “DocumentCount”] for the SQL statement above.

Caption

String

This value is included above the chart when it is displayed.

* Indicates a required field.

Example

The following example presents a DisplayMetadata field that contains two pie charts for the first dataset.

 

[

  {

    "Header": "File Type",

    "AutoAggregate": false,

    "Charts": [

      {

        "Type": "pie",

        "Caption": "File Count by File Type",

        "XAxisField": "ItemType",

        "YAxisFields": [

          "FileCount"

        ]

      },

      {

        "Type": "pie",

        "Caption": "Total Size by File Type",

        "XAxisField": "ItemType",

        "YAxisFields": [

          "TotalSize"

        ]

      }

    ]

  }

]