Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel4
classcontents
Anchor
top
top

Overview of Report API

The Report API controls the state of the report. It contains information about the current state of the report, including the current drill state, sort criteria, filter values and other report interactions that may have been applied.

...

Drill Anywhere works the same way, except it doesn’t have a predefined “drill to” field and the user (or developer if using an API call) defines which field they need to drill to.



Styleclass
ClasstopLink

top


Property Reference

name

Returns

...

A unique identifier for the report that is used to identify exactly which instance of a report object should be used. A number of events will contain this as part of the information.



Styleclass
ClasstopLink

top


ReportAPI Parameters

These parameters should be set individually for every report that requires them. For example, Assisted Insights is usually triggered from a chart, so these parameters would need to be set on the parent report's API.

...

let reportElement = this.apis.canvas.select('Performance by Region');

reportElement.onReportLoad.then(() => {

let reportAPI = reportElement.reportAPI;

reportAPI.preventDefaultAssistedInsights = true;

});


Styleclass
ClasstopLink

top



Function Reference
Anchor
functionreference
functionreference

...

Info
titleNote
You can use all the functions that BaseAPI.loadreport takes (apart from reportId, instanceName and filterValues) with createReportElement too.

...

By default, any interaction that is not explicitly set to false is treated as enabled and will display if the report allows it. 

...

animation

Allows drill down functionality chart animations to be disabled.

...

annotations

Allows drill anywhere functionality annotations to be disabled.

...

brushing

Allows drill through brushing functionality to be disabled.

...

drillAnywhere

Allows unit selection drill anywhere functionality to be disabled.

...

drillBreadcrumbs

Allows brushing drill breadcrumb functionality to be disabled.

...

drillDown

Allows the timeSlider drill down functionality to be disabled.

...

drillThrough

Allows drill breadcrumb through functionality to be disabled.

seriesSelection

Allows seriesSelection functionality to be disabled

timeSlider

Allows the timeSlider functionality to be disabled.

...

unitSelection

Allows annotations unit selection functionality to be disabled.


Example

To disable all user interactivity on the report using the createReportElement function:

report.createReportElement({

     interactions: {

            animation: false,

            annotations            drillDown: false,

drillAnywhere

            brushing: false,

drillThrough

           drillBreadcrumbs: false,

unitSelection

           drillDown: false,

brushing

           drillAnywhere: false,

timeSliderdrillThrough: false,

drillBreadcrumbsseriesSelection: false,seriesSelection

timeSlider: false,

annotationsunitSelection: false,

     }

});


sortAscending(fieldId)

...

In a lot of cases you might not see any difference between the htmlFormattedValue and the formattedValue. There are some formatters which will output HTML tags which means that you can see differences there. In the following report example, the “Gender As Link” field is formatted using a “Link To URL” formatter which generates an anchor tag to be inserted into the table.

Image Modified


The dataset for the above row looks like this:

...

Returns whether or not the report has been defined as a 'Drill Anywhere' type report. This will be true if the “Analysis Style” option is set to “Drill Anywhere” during report creation.

Image RemovedImage Added

 

isDrillDown()

...

Agency Region can drill down one level. Camp Region can drill down two levels. When they are both fully drilled down the array would contain three entries. The first would relate to “Agency Region”, the second would related to “Camp Region” and the third would relate to “Camp Country” as that is the child of Camp Region.



Styleclass
ClasstopLink

top



Event Reference

All report events will be triggered with an object that contains the following properties: 

...

  • removed: (Array) Array of drill objects that have been removed in this drill event.
    • drillState: (Array) Drill State of the entire report. See convertDrillAnywhereToArray or convertDrillDownToArray.


Anchor
reportRunAlreadyInProgress
reportRunAlreadyInProgress

reportRunAlreadyInProgress

Description

Triggered if any process tries to start a report run while the report is already running. 

Example

report.addEventListener("reportRunAlreadyInProgress", function() {

alert("report is already running");

});


resetDrill

Description

Triggered when the drill state for a field is reset or the entire reports drill state is reset. This will trigger for both Drill Anywhere and Drill Down reports.

...

  • removed: (Array) Array of drill objects that have been removed in this drill event.
    • drillState: (Array) Drill State of the entire report. See convertDrillAnywhereToArray or convertDrillDownToArray.


reset

Description

Triggered when the reports reset function is called. 

Parameters

No Event Data.


slider

Description

Triggered when a chart's time slider value is modified.

...

  • from: (Number) Lower bound of the slider values.
    • To: (Number) Upper bound of the slider values.
    • chartId: (Number) The chart which the slider was modified on.


unitSelection

Description

Triggered when a chart's 'Unit Selection' is changed.

...

  • unit: (String) The unit to be applied to the chart.
    • chartId: (Number) The chart that the unit selection was applied to.


Styleclass
ClasstopLink

top