InetSoft Product Instructions: Server-side Reporting Features

Previous chapters discussed scripts for controlling report contents, performing calculations, and other presentation-oriented tasks. Another class of scripts deals with user interactions. By adding scripts that respond to user actions, you can turn a report from a static presentation into an interactive experince. All user interactions are controlled by the report server.

view demo icon
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.

Accessing Report/Request Parameters

You can access all parameters defined in a report by using the parameter object. Two forms of syntax are available:

1. parameter.{parameter name}

 parameter.start_date =;
 Table1.visible = parameter.table_visible;

2. parameter['{parameter name}']

 parameter['StartDate'] =;
 Table1.visible = parameter['table_visible'];

HTTP Request, Session, and Principal

When you use the servlet-based report server (Repository Servlet) you can access the http request and session objects via script. Use the parameter array to access the HttpServiceRequest/HttpServiceResponse object, which are wrappers, respectively, for the HttpServletRequest/HttpServletResponse objects.

Note: Although you can set HttpSession properties directly, the it is best to set them on the SRPrincipal. SRPrincipal can be accessed universally within the script of a report or a VPM trigger.

For example, the script below handles the http session attributes and request parameters via the HttpServiceRequest object.

//accessing the service request object
var serReq = parameter['__service_request__'];

// getting session attributes
var sessAttr = serReq.getAttribute('attribute_name');

// setting session attributes
serReq.setAttribute('attribute_name', value_object);

// setting HTTP request parameter
serReq.setParameter('param_name', 'param_value');

// getting the SRPrincipal object
var p = parameter['__principal__'];

// getting a standard SRPrincipal property
var locale = p.getProperty(;

// getting a custom principal property
var prop = p.getProperty("myprop");

To get a direct handle on the HttpServletRequest object, use the following syntax:

var httpReq = serReq.getRequest(); 

Use the following simplified syntax to acquire the current username:

var userName = parameter['_USER_'];
Customer Testimonial

Style Report Professional includes a reporting engine, API, and WYSIWYG, scriptable, professional authoring environment. The software allows IT professionals to create sophisticated production reports that can be deployed for server based, or desktop based applications. The small footprint and 100% Java architecture makes it an ideal solution for embedded reporting. Based upon XML, JavaScript, and other open standards technology the reporting application allows developers to fully leverage existing skills. Style Report also includes a robust data access engine based on InetSoft's patent-pending Data Block™ technology, which enables direct access to disparate data sources and flexible, powerful data transformation such as the unique ability of end-user defined data mashup.

"We selected InetSoft's Style Report Professional for a time-tested, dependable publishing engine and a powerful, yet easy-to-use report designer that would save resources associated with internal development of publishing capabilities and client customization requests," offers Craig Christiansen, President-Technology at FPX. "We were looking for a Java-based publishing solution that could be easily integrated with our own. We have been pleased with deployment, and the reporting software's part in our ability to help companies of all sizes realize cost reduction and revenue acceleration associated with critical configuration and accurate quoting solutions."