|
ServletIntegration
Embed Web-based reporting in your application
Featured IntroductionThe report engine JAR includes a servlet providing web-based reporting. This can easily be integrated into an application by mapping the servlet in its web.xml. Servlet SetupThe g2 report engine library includes a ServletDispatcher that will receive and process requests to provide web-based reporting capabilities. You will need to add this to the project's web.xml. <servlet>
<servlet-name>report-servlet</servlet-name>
<servlet-class>com.googlecode.g2re.servlet.ServletDispatcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>report-servlet</servlet-name>
<url-pattern>/ReportViewer.htm</url-pattern>
</servlet-mapping>Report URL and ParamsYou can now run the project and generate your reports using the following URL: http://localhost:8084/ReportViewer.htm You will need to provide the page with 2 parameters:
ScreenshotsThis is an example of the user input screen where the user can provide their own input parameters for the report. This page is dynamically generated based on the report definition file provided in the URL: This is an example of an HTML generated report, once the user has provided the input parameters: |