In the Domino development environment, there is no good solution for report-based solutions. Recently, the actual report problem has been solved based on the actual needs of users in the actual project application process. You must be able to view the report directly in IE, save the report yourself, and use Excel to output the report as needed.
Since there are many statistical operations in actual report requirements, jdbc odbc is used to solve the statistical operation problem. The Servlet controls the entire report, The JDBC driver accesses NSF data in SQL statements, uses JXL to read Excel, and finally presents the report to the client in the form of a file stream, open the report in Excel.
Report Structure
The structure of the entire report is as follows.
Report Structure
Report Implementation
1. Set up Domino to run Servlet
1. Use the Domino Servlet container to manage the running of the Servlet program during the entire report output process. Therefore, you must first enable the Servlet program and configure it.
Open the server configuration document of the Domino server and find the "DominoWeb engine" tab for configuration.
Configure Servlet
Java Server applet support: Select "Domino server applet manager"
URL path of the server Applet: Enter "/Servlet"
Class path: Enter the relevant class path names, separated by semicolons (;).
Use the default value for other parameters.
Note: The URL path is relative to the ../data/domino Directory.
2. About the Servlet Development Environment JSDK
The development environment of standard DominoDesigner does not support the Servlet development environment. Therefore, you must use a third-party IDE or command line JDK to develop Servlet code. Here we use the Eclipse integrated development environment for Servlet development.
DominoServlet supports JVM and ServletManager. When the Servlet is "enabled", the JVM is loaded before the HTTP server is started. If DominoServletManager is used, it is loaded after the JVM is loaded. If a third-party ServletManager is used, only the JVM is loaded.
When you access the Servlet from a browser, the URL is http: // myserver/servlet/servletname. For example, enter the http: // myserver/servlet/DomStat running report statistics Servlet.
When the Web server starts to load the Servlet, the Servlet will start to work in the memory. However, after the Servlet code is changed, the DominoHTTP server must exit and restart to activate the new code.
You must enter the "tellhttprestart" command on the Domino console to reload the Http service.
Common Errors related to Servlet configuration files include:
◆ File directory placement error. It must be in your Domino data directory.
◆ Incorrect file extension. Many editors such as Notepad use the TXT extension.
◆ Case insensitive. The file name is case sensitive like the Servlet name.
2. Install the Notessql driver
Notessql is an ODBC driver for NSF-type databases and complies with ODBC2.0 specifications. After the Notessql driver is installed, NSF-type databases can read data using SQL statements. Currently, the latest Notessql version is 3.02. Download the corresponding installation file from the IBM website. After the download is complete, install and configure it on the machine running the Domino server.
After the installation is complete, you can select from the data source type to configure the connection to the NSF database When configuring the ODBC data source. This is an example.
Create a new data source
3. Configure the ODBC Data Source
Start Control Panel> ODBC data source to create the required system Data source:
ODBC Data Source
Select "system DSN" as the data source type, and click "add" to create an NSF-based Data source:
Create an NSF-based Data Source
Datasourcename: name of the input data source
Dominoserver: enter the name of the Domino server or the IP address of the Domino server.
Database: select the corresponding nsf Database
4. Compile Servlet
1. Select the familiar Java source code Servlet development environment. Here I select Eclipse3.1.
2. Create a Servlet class
PublicclassDomStatextendsHttpServlet {
}
3. Servlet Source Code
5. Run Servlet
After compilation, copy the output class file to the Servlet directory and directly enter http: // servername: serverport/Servlet/DomStat In the IE address bar. The running effect is as follows:
File Download
- Future Response Servlet features
- Brief Introduction to Servlet instance running
- Analysis of ServletQueryForConnPool Test
- Tomcat Java Servlet Engine Security Settings
- Jetty-Additional Servlet container Functions