Creating a report request complete event URL

Use the information in this section to create a valid Report Request Complete Event and to define the URL value in Reporting Services. Reporting Services invokes this event type for all report requests, including schedule reports.

In addition to the request parameters that Reporting Services always passes to your event program, you can have Reporting Services pass user-defined request parameters by concatenating them to the URL value as a query string. The following example contains a query string that passes the user-defined request parameter mytestgroup and its value: http://myHost:9000/context/ParameterValidator?mytestgroup=finance

Reporting Services will invoke the URL defined for this event’s user-defined program as a POST method. Reporting Services will wait for a response back from the event’s user-defined program before it completes its processing for this report request.

Note: Reporting Services invokes the URL and passes the request parameters using the POST method. The end user’s web server must be enabled to accept POST methods.

Before using variables as a part of the URL value, note the following:

  • Variables are case-sensitive.
  • You must use the at sign (@) before the variable. You must type double angle brackets around the variable. For example, <<@your_variable>>.
  • You can only specify user variables that are defined as the literal type.
  • You can specify system variables that are shipped with the Reporting Services product.

Reporting Services Passed In Request Parameters

The following table contains the request parameters that Reporting Services automatically passes with the URL that you specify.

Parameter Description
reportparams This request parameter contains the complete list of the report parameters in a name/value pair format. The format of the passed in data is Name1=Value1~Name2=Value2~Name3=Value3 where Name represents a report parameter name and Value represent the report parameter value selected or entered by the user for this report request. The tilde (~) character is used as a delimiter to separate multiple passed in report parameters.

For report parameters that allow their value to be null (blank) and have been selected to be blank by the user requesting to view the report, the passed in report parameter will be of the format Name=. For example, reportparams=Cost Center= states the report parameter named Cost Center has a null or blank value. The pipe ( | ) character is used as a delimiter for the case when a report parameter has been selected to contained multiple values. For example, reportparams=Company=ABC|EFG|LMN states the report parameter named Company has the three values of ABC, EFG, and LMN.

reportname This request parameter represents the name of the report given when it was published to the Reporting Services repository.
fsuserid This request parameter represents the name of the Reporting Services user requesting to view the report.

Reporting Services Values to be Passed Back to Reporting Services

At a minimum, the user-defined application must return a status to Reporting Services.

Item Description
status Set the status value to zero (status=0) in the case that the event program was successful.

Set the status to a non-negative value greater than zero when the event program failed.

This is code sample:

// Perform report request complete work unique to the user 
// defined application Did not find an error, so define status as passed
String returnStatus = "status=0";

// Send the status string (possibly with an error message) back to 
// the LBI ERS web application by using or writing to the 
// OutputStream retrieved from the HttpServletResponse object.
PrintWriter out = response.getWriter();
out.println(returnStatus);
out.flush();
out.close();