You have a report engine and a report viewer running on different machines and you want to connect these components? This can be done either using the standalone socket-listener (programming using the socket-listener is described here) which is built into i-net Clear Reports or you use a web-server and a servlet-engine such as Apache-Tomcat, Bea WebLogic or IBM WebSphere.
The following sections describe how to use the report servlet we ship with i-net Clear Reports.
The report servlet mediates between the client and the engine. It must wait for client requests and respond by sending back the requested data.
It does this in two steps:
With the help of the report engine the servlet must:
If you look at the javadoc documentation of com.inet.report.ReportServlet, you see that the servlet uses the public methods doWriteHtmlPage() and doExecRequest(). The former is executed in step1 while doExecRequest() is executed in step 2 from within the service method, right before the servlet's doGet() and doPost() methods are called.
The methods receive the servlet request and response and a bag of URL decoded parameter/value pairs from either the get line of from the parameter list with the keys converted to lowercase. If you throw an exception within these methods, the exception will be caught and a proper error message is sent back to the client.
The default-method doWriteHtmlPage() calls the hook checkHtmlPageProperties() which could be used to change the parameters of the default HTML page. The default-method doExecRequest() calls two hooks, first checkProperties(properties, request) is called which can be used to change the report file according to the servlet request context. The second callback checkProperties(engine, properties, request) is called after the engine has been initialized with the default values from the report file and can be used to examine and change the default values.
If you override the default-method doExecRequest(), you may find the engine's method getPageCountData() and get/setErrorData() helpful.
i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to clearreports@inetsoftware.de.