Running dashboards via URL

Similar to reports, dashboards can be created or run directly from your application. JDashboard uses /{context_root}/dashboard/app/entry/run.jsp as the URL entry. Here {context_root} is the servlet's context root when deployed in a WAR or EAR file as a servlet.

Creating a new dashboard

To create a new dashboard from URL, simply use /{context_root}/dashboard/app/entry/run.jsp.

For example, run the URL http://localhost:8888/dashboard/app/entry/run.jsp, and JDashboard will be opened with a new blank dashboard in it. You can then begin to build your dashboards.

Visiting JDashboard as the server home page

After JDashboard has been set as the server user console home page, you can use a URL to access the home page.

Parameter name: jrd_lastsession
Parameter value: true/false
Examples:

Opening specific dashboards

JReport provides parameters for developer users to run dashboards via URLs. Some parameters are encapsulated as JSON (JavaScript Object Notation) objects. Therefore, it will help if you obtain some knowledge on JSON to understand the syntax more clearly. When composing the URL, you need to use URL encoding to avoid errors. To encode URLs by JavaScript, the function encodeURI is recommended.

Examples:

Switching data source connection in URL

Add a property in jrd_resext:

Example:

http://localhost:8888/dashboard/app/entry/run.jsp?jrd_resext={active:0,reslst:[{name:"/USERFOLDERPATH/admin/Dashboard 1.dsh",dsh_datasources:[{jrd_datasources:[{"ds":"Data Source 1","uid":"test","pwd":"1234","type":"0","url":"jdbc:oracle:thin:@127.0.0.1:1521:ora8i","driver":"oracle.jdbc.driver.OracleDriver"}]},{lc_names:["/COMPONENT_LIB/SampleReports/Country Sales by Category.lc","/COMPONENT_LIB/SampleReports/Sales Bar.lc"],jrd_datasources:[{"ds":"Data Source 1","uid":"test","pwd":"1234","type":"0", "url":"jdbc:oracle:thin:@127.0.0.1:1521:ora8i","driver":"oracle.jdbc.driver.OracleDriver"}]}]}]}

Authentication parameters

jrs.authorization, jrs.auth_uid and jrs.auth_pwd are supported.

Example for jrs.authorization:

http://<IP>:<port>/jreport/dashboard/app/entry/run.jsp?jrd_resext={active:0,reslst:[{name:"/USERFOLDERPATH/admin/Dashboard 1.dsh",ver:-1}]}&jrs.authorization=YWRtaW46YWRtaW4%3D

Example for jrs.auth_uid and jrs.auth_pwd:

http://<IP>:<port>/jreport/dashboard/app/entry/run.jsp?jrd_resext={active:0,reslst:[{name:"/USERFOLDERPATH/admin/Dashboard 1.dsh",ver:-1}]}&jrs.auth_uid=admin&jrs.auth_pwd=admin