Setting Input Control Values

The following method updates the state of current input control values, so they are set for the next run of the report.

Method

URL

POST

http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/path/to/report/inputControls/<ic1>;
<ic2>;.../values/

Content-Type

Content

application/json

A JSON object that lists the new selected values. The value of every input control is given as an array of string values, even for single-select controls or multi-select controls with a single value. See also the example below:

{
  "boolean-input-control" : ["true"],
  "integer-input-control" : ["123456"],
  "single-select-input-control" : ["some value"],
  "multiple-select-input-control-1" : ["another value"],
  "multiple-select-input-control-2" : ["first", "second", "third"]
}

Options

accept: application/json

Return Value on Success

Typical Return Values on Failure

200 OK – The content is a JSON object that describes the new selection of input control values.

404 Not Found – When the specified report URI is not found in the repository.

Assuming the client receives the response given in section Listing Input Control Values, it can send the following request body:

{
   "Country_multi_select":["Mexico"],
   "Cascading_state_multi_select":["Guerrero", "Sinaloa"]
}

When specifying the option for the JSON format, the server’s response is:

{
  "inputControlState" : [ {
    "uri" : "/reports/samples/.../Country_multi_select",
    "value" : "",
    "options" : {
      "option" : [ {
        "label" : "Canada",
        "selected" : "false",
        "value" : "Canada"
      }, {
        "label" : "Mexico",
        "selected" : "true",
        "value" : "Mexico"
      }, {
        "label" : "USA",
        "selected" : "false",
        "value" : "USA"
      } ]
    }
  },
  ...
  ]
}
Version: 
Feedback