Crystal Reports configuration
suzyrizzo Dec 7, 2004 4:50 PMI'm trying to integrate some crystal reports into my application, and I can't seem to configure things correctly. The crystal jars are found ok, but the crystal config file is not found. Crystal tech support insists that the config file simply needs to be "on the classpath". I guess I'm not sure what that means in JBoss.
The versions I'm using are JBoss 3.2.5 and Crystal Reports 10.
Here's the most recent version of my setup:
jboss/server/all/lib (Crystal jars)
CrystalCommon.jar
CrystalFCM.jar
CrystalQueryEngine.jar
CrystalReportEngine.jar
rascore.jar
webreporting-core.jar
jboss/server/all/deploy/MyApp/WEB-INF/classes (Crystal config file)
CrystalReportsEngine-config.xml
The error I get is from crystal's report engine. Here's a snippet of the log:
16:28:01,984 INFO [STDOUT] Opening report: userInfo.rpt 16:28:05,468 ERROR [reportengineinterface] Unable to locate CrystalReportEngine-config.xml 16:28:05,531 INFO [STDOUT] com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Report location is not specified in the configuration file---- Error code:-2147215356 Error code name:fileNotOpened
And the error is coming from the first line in the try block of this code (where I try to create a crystal report):
public void genReport(String report, HttpServletRequest sreq, HttpServletResponse sresp, ServletContext contxt) { System.out.println("Opening report: " + report); IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory(); CrystalReportViewer viewer = null; try{ IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report, Locale.US); viewer = new CrystalReportViewer(); viewer.setReportSource(reportSource); viewer.setOwnPage(true); viewer.setEnableLogonPrompt(true); viewer.setHasRefreshButton(true); viewer.showFirstPage(); viewer.processHttpRequest(sreq, sresp, contxt, sresp.getWriter()); viewer.dispose(); } catch(Exception e) { System.out.println(e); setError(true); setErrmsg(e.getMessage()); } }
And the content of CrystalReportsEngine-config.xml:
<?xml version="1.0" encoding="utf-8"?> <CrystalReportEngine-configuration> <reportlocation>/view</reportlocation> <timeout>10</timeout> <keycode>MyLicenseKeyCodeHere</keycode> </CrystalReportEngine-configuration>
I'd love to hear from anyone who has gotten Crystal & JBoss to work together...or from JBoss users who can suggest where (and why) I might put the config file so that it's "on the classpath."
Thanks,
Sue.