1.37 Viewing analytical resource representations

DHIS2 has several resources for data analysis. These resources include charts , maps , reportTables , reports and documents . By visiting these resources you will retrieve information about the resource. For instance, by navigating to api/charts/R0DVGvXDUNP the response will contain the name, last date of modication and so on for the chart. To retrieve the analytical representation, for instance a PNG representation of the chart, you can append /data to all these resources. For instance, by visiting api/charts/R0DVGvXDUNP/data the system will return a PNG image of the chart.

Analytical resources
Resource Description Data URL Resource representations
charts Charts api/charts/<identifier>/data png
eventCharts Event charts api/eventCharts/<identifier>/data png
maps Maps api/maps/<identifier>/data png
reportTables Pivot tables api/reportTables/<identifier>/data json | jsonp | html | xml | pdf | xls | csv
reports Standard reports api/reports/<identifier>/data pdf | xls | html
documents Resources api/documents/<identifier>/data <follows document>

The data content of the analytical representations can be modified by providing a date query parameter. This requires that the analytical resource is set up for relative periods for the period dimension.

Data query parameters
Query parameter Value Description
date Date in yyyy-MM-dd format Basis for relative periods in report (requires relative periods)
Query parameters for png / image types (charts, maps)
Query parameter Description
width Width of image in pixels
height Height of image in pixels

Some examples of valid URLs for retrieving various analytical representations are listed below.

/api/26/charts/R0DVGvXDUNP/data
/api/26/charts/R0DVGvXDUNP/data?date=2013-06-01

/api/26/reportTables/jIISuEWxmoI/data.html
/api/26/reportTables/jIISuEWxmoI/data.html?date=2013-01-01
/api/26/reportTables/FPmvWs7bn2P/data.xls
/api/26/reportTables/FPmvWs7bn2P/data.pdf

/api/26/maps/DHE98Gsynpr/data
/api/26/maps/DHE98Gsynpr/data?date=2013-07-01

/api/26/reports/OeJsA6K1Otx/data.pdf
/api/26/reports/OeJsA6K1Otx/data.pdf?date=2014-01-01