BackPrevious Page Next PageNext

Using the Server API

This section shows using JReport Server API to achieve specific goals.

The HTTP methods GET and POST are available for almost all of JReport commands. The following is an example of using the POST method in Java program:

URL url = new URL("http://jrserver:8888");
URLConnection uc = url.getConnection();
if (uc instanceof HttpURLConnection) {
  HttpURLConnection huc = (HttpURLConnection)uc; 
  //set use POST method.
  huc.setRequestMethod("POST");
  huc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  huc.setDoOutput(true);
//write the HTTP query to the output stream. OutputStreamWriter writer = new OutputStreamWriter(huc.getOutputStream()); writer.write("jrs.cmd=jrs.get_subnodes"); writer.close(); huc.getHeaderField(0);
//get the response content from the server. InputStream inStream = uc.getInputStream(); if (inStream != null) { BufferedReader reader = new BufferedReader(new InputStreamReader(inStream)); String inputLine; while (null != (inputLine = reader.readLine())) { System.out.println(inputLine); } } }

Pick a task from below:

Creating and Getting Instances of the ReportEngine

Creating and Getting Instances of RptServer or HttpRptServer

Using JSP Page with a Dedicated Machine

Using RMI in JReport Server

Working with Resource Versions

Changing the Runtime Database Connection

Scheduling a Report Task

Scheduling a Customized Task Using User Task

Applying TaskListener

Writing Customized Load Balancing Algorithm

Setting Server Reporthome and Properties in a Java EE Environment

Loading User Data Source Classes at Runtime

Applying a User Defined CSS to the HTML Result File

Specifying Parameter Values

Specifying Report Running Properties in the Session

Tracing Server Resource Change Events

Configuring the Security Cache System

Customizing the Web Report Studio Toolbar

Customized Implementation of the Security API

Specifying Paths for the Result Files When Using On-Demand API

Applying the Implementations of the Dashboard Listener API

Using the NLS API

Dynamic Connection API

Dynamic Security API

Information Bus API

BackPrevious Page Next PageNext