BackPrevious Page Next PageNext

Specifying Report Running Properties in the Session

For running reports via server JSP

For running web reports via JSON

For running dashboards via JSON

When designing integration and security with your application, compared to putting all information in the URL, setting sensitive information in the session and letting the server fetch them when running reports is a more secure way.

JReport provides the key JReport_running_parameter for holding property variables in the session. You can set a String or Map object as the session attribute with this key before calling JReport services. For example:

HttpSession httpSession = ...;
Map<String, String> ssnVariable = new HashMap<String, String>();
ssnVariable.put("jrs.param$psessionurl", "Sample+Data.json");
httpSession.setAttribute("JReport_running_parameter", ssnVariable);
...

For a String object, it should take the query string format used in the URL for running reports or dashboards and obey application/x-www-form-urlencoded format and be encoded by UTF-8. For example, the application/x-www-form-urlencoded format requires that blankspace should be encoded as "+", in the above sample code, if a String object is used, after JReport Server decodes URL from session variable, "Sample+Data.json" becomes "Sample Data.json". For a Map object, the quoted value will be used directly without any change.

When you run reports or dashboards via URL, JReport gets information first from the URL and then picks up provided information from the session using the key. For information that exists in both the URL and the session, the session setting overrides that of the URL.

For properties both in the URL and the session, the properties in the session will override those in the URL. For properties only in the session, the properties will be appended to the URL to run the report or dashboard.

For running reports via server JSP

Examples:

For running web reports via JSON

The following rules are about some special properties when merging them from the session and from the URL:

Examples:

For running dashboards via JSON

The following rules are about some special properties when merging them from the session and from the URL:

Examples:

BackPrevious Page Next PageNext