Skip to Content
0
Former Member
Jun 24, 2009 at 12:23 PM

JSP Calling Crystal Report having Stored Procedure

25 Views

Hi i am calling a crystal report from jsp where the crystal report is designed using stored procedure but the report does not get displayed and shows errors

my jsp file is

<%@ page import="com.crystaldecisions.report.web.viewer." %> 

<%@ page import="com.crystaldecisions.sdk.occa.report.data." %> 

<%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %> 

<%@ page import = "java.util.*" %> 

<% 
try{ 

Object reportSource = session.getAttribute("reportSource"); 

if (reportSource == null) 

{ 

String report = "Report4.rpt"; 

ReportClientDocument reportClientDoc = new ReportClientDocument(); 

reportClientDoc.open(report, 0); 

reportSource = reportClientDoc.getReportSource(); 

session.setAttribute("reportSource", reportSource); 

} 


CrystalReportViewer viewer = new CrystalReportViewer(); 

viewer.setReportSource(reportSource); 

viewer.setEnableParameterPrompt(false); 



if (session.getAttribute("refreshed") == null) 

{ 

viewer.refresh(); 

session.setAttribute("refreshed", "true"); 

} 


viewer.setOwnPage(true); 

viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null); 

} 
catch(Exception e) 
{ 
e.printStackTrace(); 
} 
%>

error:

com.crystaldecisions.report.web.viewer.CrystalReportViewer

Unexpected Query Engine error

the Report4.jsp connects to the database using oracle Native connection. the Report runs perfectly well when i open it directly from crystal report viewer.

am using crystal report XI.. It works with basic report if report contains a table instead of stored procedure the report opens when i call it from JSP but here in Report4.rpt there is a stored procedure that has cursor as out paramter, I dont see any error in the stack trace... also i tried executing the Report4.rpt(containig stored procedure) with different datasources like ODBC,JDBC,Oracle Native it still gives me the Unexpected Query Engine Error .. and i dont find much data related to this error.

The crystal report viewer is the one that comes with Crystal report XI .. and the report is designed on it.

I created a JDBC connection in the report and also in the web.xml file of my application running under Tomcat. a normal rpeort without a stored procedure is easily called from JSP where as when i call report with Stored procedure it throws Unexpected Query engine error.

web.xml has entries

<env-entry>

<env-entry-name>jdbc/ccbuat</env-entry-name>

<env-entry-type>java.lang.String</env-entry-type>

<env-entry-value>!oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:cisadm/cisadm@moasrv07:1521:ccbuat</env-entry-value>

</env-entry>

Please suggest me something.

Edited by: MoalajahRT on Jun 24, 2009 2:23 PM