Java API for an Application
Logi JReport provides two ways for the application to call Logi JReport directly without using JSP pages and URLs.
- Logi JReport Server API: Logi JReport provides a library of methods to directly start Logi JReport Server as part of the customers application running in the same JVM as the application.
- Logi JReport Remote Server API: Logi JReport provides methods to connect to an already running instance of Logi JReport Server either running on the local machine in a different JVM or running on an entirely different server. Other than the first call to connect either using RMI or directly in the current JVM, the rest of the API is identical so it is easy to write an application that can work either remotely or locally the same as the JSP pages that Logi JReport provides.
If you want the entire Logi JReport Server to run in the context of your application in the same JVM you can use the Server API. The Server when started this way starts a number of threads and runs exactly the same as when the server is started as a standalone server. The server just starts with the application and stops with the application. All access to the server such as RMI access from other applications is still allowed.
// Creates instance of RptServer ( this does nothing if Logi JReport Server is already running in this JVM)
// Get a handle to the server instance
RptServer server = HttpUtil.getHttpRptServer();
It is exactly the same code as above except you get a remote handle to the RPTServer.
//set reporthome for logging and location of rmi.auth file for security
//search the running server using default host and port
String host = "localhost";
String port = "1129";
RptServer server = :diffupdate