DEPLOYMENT OF CRYSTAL REPORTS ON APACHE TOMCAT
Task was to deploy the crystal reports on Apache tomcat, in order to view the reports on web browser.
We have perform following steps to do this,
Applications used are,
- Java Eclipse for crystal reports 2008.
- JDK 1.6.
- Apache Tomcat.
- Any web browser.
- Mysql connector for java.
- Adobe flash player 9 and above.
- Crystal Report 2008.
NOTE: we can make crystal reports on java eclipse, since we are using dynamic parameters in the reports we use Crystal report 2008.
- Install all the above applications
- Create an Environment variable
- Go to My computer properties and click Advance tab and then Environment variables button.
- Click New in Environment Variables.
- Enter Variable Name as CLASS PATH
- Variable Value as C:\Program Files\Java\jdk1.6.0_06\lib
- Open java eclipse which you have installed
- Select File New-> Projects and then
Select Crystal Reports -> Crystal Reports web Project
- Click Next and then
Give Project Name -> Check the Default Location and-> Configuration as Crystal Report web Project
- Click Finish
- You can create Crystal report using Java Eclipse for Crystal report, to create a sample report right the Folder which you created (Test_Cry)
click New ->Others
- Select Crystal Reports ->Blank report
- Give Report Name and click Finish.
- Select Xtreme sample Database
- And select the table you want Example:Customer table
- Drag and Drop the Tables into the Report
- Click the Layout Field and the Drag and Drop the fields from the table in the Field Explorer, Fields like City, Country and Region.
- Click Preview tab to view the data.
- Then save the report and click java Button on the right top. You can view your report now. Example Report1.rpt
- Now in order to view the Crystal report on Crystal report Viewer.
- Right click the Report1.rpt you have made and click Crystal Reports-> Crystal Report Viewer JSP
- Select Insert Crystal Reports Code Snippets
- Then click ok
- Report1-viewer.jsp will be created and click the report and run it
- Select the local host and click Finish
- This was a simple report using Eclipse.
Create a report in crystal report 2008 with Mysql as Data source using JDBC
- Copy the Mysql-connector-java.rar file and paste it inside LIB “C:\Program Files\Business Objects\common\4.0\java\lib”
- Open CRconfig.XML file in “C:\Program Files\Business Objects\common\4.0\java” and add the MySQL-connector-java inside the class path “C:\Program Files\Business Objects\common\4.0\java/lib/mysql-connector-java-5.1.18-bin.jar”
- And then inside JDBC give the Jdbcurl, class name and username and save the file.
Now create a report in crystal report 2008 with parameters and
- Go to file and uncheck the option save with data.
- And save the report.
- Then drag that report to Test_cry inside web content
- Then rightclick the report Crystal Reports ->Crystal Report Viewer JSP
- In options select Insert Crystal report Code snippets and set runtime database credentials
- And in parameter select set values for parameters used in the report
- And in output option select view report using report page viewer and click OK
- Day2-viewer.jsp will be created
- open that and inside give your own database credentials and then save the report
- Run the report on TOMCAT
- Now to run the report on the browser
- Copy the URL and run it on any browser
- Click on the parameters and then give the parameters required
- Click apply
- Now you can view your report created on Crystal report 2008 in the browser.