how to pass parameters to dashboard using visualize js, without input controls

0

Verions 6.4.3

We have a set of "well known" parameters that we want to pass to a dashboard via visualize.js - eg user_name - the application knows these so input controls would only make the UI ugly.

We have a Dashboard defined that has a uses a JRXML as a report that uses parameters, these come across in the (internal to visualize) compnents call as parameters to the server

[
  {
    "type": "value",
    "name": "user_name",
    "label": "User Name",
    "id": "user_name"
  },
  {
    "id": "DashboardProperties",
...
  },
  {
    "type": "adhocDataView",
    "label": "AMS Menus",
    "resource": "/public/AMS_Menus",
...
    "dataSourceUri": "/public/AMS_Menus",
    "parameters": [
      {
        "id": "user_name2_1",
        "label": "user_name",
        "valueType": "java.lang.String",
        "uri": "/public/AMS_Menus",
        "multipleValues": false
      }
    ],
    "outputParameters": []
  },
  {
    "type": "reportUnit",
    "label": "Input Control Test Report",
    "resource": "/public/Reports/Input_Control_Test_Report",
    "id": "Input_Control_Test_Report",
...
    "outputParameters": [],
    "parameters": [
      {
        "id": "owner_id",
        "label": "owner_id"
      },
      {
        "id": "user_name",
        "label": "user_name"
      }
    ]
  }
]

However when these are set into the params of the dashboard object they are not sent in the reportExecutions call to the backend:

var dashbd = visualizejsObject.dashboard({
                                resource: resource,
                                container: "#" + reportObjId + "_js_dashboard",
                                //
                                // The parameters for the dashboard - have all the standard ones as above
                                //
                                params: inputControlParameters,

Where inputControlParameters is a JSON object with user_name as an array.

This seems to be exactly as per the documentation.

Does anyone have a working end-to-end example of this ?

dbetterton's picture
Joined: Oct 11 2019 - 10:14am
Last seen: 3 weeks 5 days ago

If the input control is defined as not visible then this appears to work, and there's nothing in the UI.

However any manually added parameters are never actually passed to the reportExecutions API call, even though they are listed in the parameters for the dashlet/report - that seems like a bug

dbetterton - 4 weeks 13 hours ago

0 Answers:

No answers yet
Feedback
randomness