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

JSP Calling Crystal Report having Stored Procedure


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="" %> 

<%@ page import="" %> 

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

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


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

if (reportSource == null) 


String report = "Report4.rpt"; 

ReportClientDocument reportClientDoc = new ReportClientDocument();, 0); 

reportSource = reportClientDoc.getReportSource(); 

session.setAttribute("reportSource", reportSource); 


CrystalReportViewer viewer = new CrystalReportViewer(); 



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



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



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

catch(Exception e) 


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






Please suggest me something.

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