Page tree
Skip to end of metadata
Go to start of metadata

Suppose you want to run a report directly via a URL, you can now do this in Reporting 0.11.0. It supports the passing of parameters as specified in the URL.

Parameters

The parameters that this supports are:

  • reportDefinition: uuid of the report definition to run
  • renderingMode: <fully specified java class name of renderer>!<argument for rendering mode>
  • patient: (this is optional, and will limit the report so that it only runs for this single patient if supplied. this can be either the patient uuid or patient id)
  • download=true: (this is optional, if supplied it will download to file rather than display on screen)

In addition, any parameter of the report definition can be passed in as an additional request parameter, where the value is in the format that can be parsed by htmlwidgets. This generally means that metadata needs to be passed as a uuid, and dates should be in the format yyyy-MM-dd.

Example URLs

The following are examples of URL's showing the use of parameters. This first example shows a generic URL.

URL Example
http://localhost:8080/openmrs/module/reporting/reports/renderReport.form?reportDefinition=c037ad86-d3ed-461b-86d5-f0f2c1c89d86&patient=85ffa50c-bcf4-48ea-89ce-47617fbdbcdb&renderingMode=org.openmrs.module.reporting.report.renderer.TextTemplateRenderer!40b601c5-a801-4691-a7df-1c0ee0232a6e

This second example shows a URL used in HTML Form Entry with the <redirectOnSave> tag. Notice the amperstand (&) is replaced with &amp;

HTML Form Entry URL Example
<redirectOnSave url="/module/reporting/reports/renderReport.form?reportDefinition=76cfc87a-9e88-4d39-acc7-ed68d4beb1f7&amp;patient_wanted={{patient.id}}&amp;renderingMode=org.openmrs.module.reporting.report.renderer.TextTemplateRenderer!d45c199d-c004-4ee4-aa8d-6a8061d7d9a5"/>