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:

Opening dashboards and reports via one URL

It is similar to opening multiple dashboards.

jrd_resext={

"active":0, // The index number of the dashboard/report that will be active once the JDashboard is loaded. 0 means the first dashboard/report specified in the value list of the parameter "reslst", 1 the second, 2 the third, and so on.
"reslst":[

// Specify the dashboards and reports to open. The order of them specified here reflects the order they are displayed in the JDashboard.

{

"name":"ResourceFileNameWithFullPath", // The dashboard/report file name with its full path. The path could be a disk path or a server resource tree path. For the latter, it could be either in the My Reports folder (/USERFOLDERPATH/admin/) or in the Public Reports folder (/).
"ver":"-1", // Optional: The version number of the dashboard/report. -1 means the latest version.
"real":"false", // Optional. Value: true/false. true means the resource path is a real disk path and false means a server resource tree path. When it is a real path, "real":"true" must be specified.
"type":"xx", // Indicates the type of the resource. Value: 40/44/45. 40 means it is a dashboard, 44 a web report, and 45 a page report.
"param_page":"true", // Optional. Value: true/false. Specify whether to pop up the parameter dialog if the report uses parameters.
"dependence":{ // For reports only.

"catalog":{ // Specify the catalog of the report.

"name":"ResourcePath/CatalogName", // The resource path of the catalog used by the report. It could be a disk path or a server resource tree path.
"ver":"-1", // Optional: The version number of the catalog. -1 means the latest version.
"real":"false" // Optional: true means the resource path is a real disk path and false means a server resource tree path.

}

},
"dsh_datasources":[{
// Specify the data source used in the dashboard/report. For a dashboard, one or more groups can be specified. For a report, only one can be specified.

"lc_names":["lc1","lc2",...], // Optional. Only for dashboards.
"jrd_datasources":[{datasource1},{datasource2},...] // For dashboards, refer to jrd_datasources. For web reports, refer to jrd_datasources.

}],
"dsh_params":[
// Specify the parameter values used in the dashboard/report. For a dashboard, one or more groups can be specified. For a report, only one can be specified.

{

"lc_names":["lc1","lc2",...], // Optional. Only for dashboards.

"jrd_params":{"parameter1":"value1","parameter2":["value1","value2",...]}

}

]

},

...

// Another way to specify a report to open.

{

"name":"a part of running report URL", // Specify a part of a URL as the value. The URL should be the one used for running the report via the tryView.jsp or runReport.jsp. The value extracts the URL part started with "tryView.jsp" or "runReport.jsp" and encodes the URL reserved words such as "?" and "&". For example, the extracted original URL is "tryView.jsp?jrs.cmd=jrs.try_vw&jrs.report=%2fShipmentStatus.wls&jrs.catalog=%2fSampleReports.cat&jrs.result_type=8", the encoded URL that can be set as the value will be "tryView.jsp%3Fjrs.cmd%3Djrs.try_vw%26jrs.report%3D%2FShipmentStatus.wls%26jrs.catalog%3D%2FSampleReports.cat%26jrs.result_type%3D8". "type":"46/47" // The type of the report. Value: 46/47. 46 means it is a web report, 47 a page report.

}

]

}

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/Country Sales by Category.lc","/COMPONENT_LIB/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"}]}]}]}

Note: In the case when the URL does not specify a data source connection for a specific library component but a dashboard level connection is available, if later a new library component is added into the dashboard, it will use the connection in the URL.

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