On the server side you need to start the report listener in your application. After the report listener is started it listens for report requests. If a new report request has been received the listener does the following:
The following line starts the report listener thread:
// Create the Listener that listens for report requests and that hands the report requests over to the engine static Listener reportListener = new Listener();
Tip: Add this line to the main class (java file that contains the main() method) of your server application.
The Java viewer can be integrated in a Java application or a Java applet on the client side. To do this you need to add the report viewer to your code. The following two examples show the integration of the report viewer in a Java application or in a Java applet.
This example shows the report viewer javabean in a new window that will be opened after a button is clicked:
… // Create a target window for the viewer Window window = new Dialog(this, "Report Viewer"); window.setSize(Toolkit.getDefaultToolkit().getScreenSize()); window.show(); // Create the Report Viewer SwingReportViewer viewer = new SwingReportViewer(); // Create the connection to the report server URLRenderData myConnection = new URLRenderData(requestString); // Create the report view and set the connection to the report server viewer.addNewReportView(myConnection); // Add the report viewer to the window window.add( BorderLayout.CENTER, viewer); …
After creation of the new window and the report viewer the following values need to be configured:
These values are sent by the report viewer as a request to the report engine (requestString). An example for a request string looks like:
http://<hostname>:<portnumber>?report=file:C:/reports/reportfile.rpt&datasource=MySQLServer # (The path of the report file must be a path on the server).
To set the requestString you can use a text field or other components (e.g., other text components) to set the report name and the necessary parameters. Another example for setting the report name is to read it from a database where all locations of the reports are saved.
In an applet you can add the report viewer javabean to a panel (as an example)
… // Create the Report Viewer SwingReportViewer viewer = new SwingReportViewer(); // Create the connection to the report server URLRenderData myConnection = new URLRenderData(requestString); // Create the report view and set the connection to the report server viewer.addNewReportView(myConnection); // Add the report viewer to the panel add("Center", viewer); …
After creation of the report viewer the following values need to be configured:
These values are sent by the report viewer as a request to the report engine (requestString). An example for a request string looks like:
http://<hostname>:<portnumber>?report=file:C:/reports/reportfile.rpt&datasource=MySQLServer
To set the requestString you can use a text field or other components (e.g., other text components) to set the report name and the necessary parameters. Another example for setting the report name is to read it from a database where all locations of the reports are saved.
If you do not have a Java application on the server side in that you can integrate i-net Clear Reports or you don't like to implement a server application you can use i-net Clear Reports as Java server application and thus only need to implement the client.
In this case you use i-net Clear Reports as Java application without the integration in your Java application. To do this follow the steps of the application installation.
After you have installed the Java server application i-net Clear Reports you can request reports from a client.
The Java viewer can be integrated in a Java application or a Java applet on the client side. To do this you need to add the report viewer to your code. See the section above for two examples that show the integration of the report viewer in a Java application or in a Java applet.
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.