Jump to content
Changes to the Jaspersoft community edition download ×

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


dbetterton

Recommended Posts

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"      }    ]  }][/code]

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,[/code]

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 ?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...