Loading the Desktop Viewer Bean from a URL or RandomInputable directly

Here, we assume that you have your own server, which you built with the JReport Server Engine. If you want to load the Desktop Viewer Bean to view a result file generated on the server side, but you do not want to transport the result file directly, you can use the following methods:

We provide a class that has already implemented the interface RandomInputable. If you do not want to write a new class, you can use this. The class is named jet.ie.io.RAStreamInput. It has one constructor public RAStreamInput(InputStream in, long totalLength) throws IOException.

The first parameter is the input stream opened by the connection. The second is the stream's length. See example TestRAStreamInput.java in <install_root>\help\samples\APIClient\ViewerBean.

Note: In the above case, you do not need to set the other properties of the Viewer Bean. Also, if JReport Server requires a permission check for login, this will have to be performed before calling the Desktop Viewer Bean.