Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CALLING ORACLE STORED PROC FROM JSP

Status
Not open for further replies.

giggles7840

IS-IT--Management
Mar 8, 2002
219
US
I have a crystal report that is pulling data from a stored proc. i need to publish the rpt file using jsp. i can get the report to pull up but there is no data. its as if jso is not seeing the odbc connection or my parameter. i know very little about jsp and could use some help.

below are my jsp pages.. there are two one pulls the parameters and the other fires the rpt.

parameter code:
<%@ page language=&quot;java&quot; %>
<%@ page import=&quot;java.util.*&quot; %>
<%@ page import=&quot;javax.sql.DataSource&quot; %>
<%@ page import=&quot;org.jdom.*&quot; %>
<%@ page import=&quot;com.maincontrol.rp.beans.*&quot; %>
<%@ page import=&quot;com.maincontrol.rp.query.*&quot; %>

<%@ taglib uri=&quot;/WEB-INF/dbtags.tld&quot; prefix=&quot;dbtags&quot; %>

<%
// CostCenterReport.jsp - Version 1.00 - 01/29/2002 17:47

// Fetch the db.query.vreport.costcenter attribute from the db-statements application scope!
Document dbStatements = (Document)application.getAttribute(&quot;db-statements&quot;);
Vector hlq1Vector = (Vector)application.getAttribute(&quot;list-tables-hlq1&quot;);
Vector hlq2Vector = (Vector)application.getAttribute(&quot;list-tables-hlq2&quot;);

User currentUser = (User)session.getAttribute(&quot;user&quot;);
HLQDualSet hlqSet = (HLQDualSet)currentUser.getOptions().get(&quot;hlqSet&quot;);

SimpleXMLPreQuery prequery = new SimpleXMLPreQuery(dbStatements, &quot;preQuery&quot;, &quot;db.query.vreport.costcenter&quot;);
String queryString1 = prequery.generateQualifiedPreQuery(hlq1Vector, hlq2Vector, hlqSet);


// Prepare a holding String field...
String parmValue;
%>
<HTML>
<HEAD>
<title>Cost Center Report</title>
<link rel=&quot;stylesheet&quot; href=&quot;rportal-main.css&quot;>

</HEAD>
<BODY>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;>
<tr>
<td class=&quot;portlettitlebox&quot; align=&quot;left&quot; valign=&quot;top&quot;>
<div align=&quot;right&quot;>Cost Center Report</div>
</td>
</tr>
</table>
<br>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;C_Rep_CostCenterReportFire.jsp&quot;>
<p>Enter A Cost Center parameter for the Cost Center Report:</p>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;3&quot; cellpadding=&quot;3&quot;>
<tr>
<td>
<div align=&quot;right&quot;>Cost Center :</div>
</td>
<td>
<div align=&quot;left&quot;>

<input type=&quot;text&quot; name=&quot;name&quot; maxlength=&quot;30&quot; size=&quot;30&quot; value=&quot;&quot;>
</td>
</tr>

</div>
</td>
</tr>
<tr>
<td>
<div align=&quot;right&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
</div>
</td>
<td>
<div align=&quot;left&quot;>
<input type=&quot;reset&quot; name=&quot;Reset&quot; value=&quot;Reset&quot;>
</div>
</td>
</tr>
</table>
</form>
<p>&nbsp;</p>
</BODY>
</HTML>


Fire code:
<!-- Version 1.00 - 01/29/2002 12:04 -->
<%@ page language=&quot;java&quot; %>
<%@ page import=&quot;com.maincontrol.rp.admin.*&quot; %>
<%@ page import=&quot;com.maincontrol.rp.beans.*&quot; %>
<%@ page import=&quot;com.maincontrol.rp.query.*&quot; %>
<%@ page import=&quot;java.lang.*&quot; %>
<%@ page import=&quot;java.util.*&quot; %>

<%@ taglib uri=&quot;/WEB-INF/struts-bean.tld&quot; prefix=&quot;bean&quot; %>
<%@ taglib uri=&quot;/WEB-INF/struts-html.tld&quot; prefix=&quot;html&quot; %>

<%@ include file=&quot;FireFragmentA.lssi&quot; %>
<title>Cost Center Report (Fire!)</title>
<%@ include file=&quot;FireFragmentB.lssi&quot; %>

<%
String prompt0 = (String)request.getParameter(&quot;prompt0&quot;);
%>

<%
String table = &quot;KOMP&quot;;
String view = &quot;XREP_KOMP_BY_ACQ_MODE&quot;;
%>

<%@ include file=&quot;FireFragmentC.lssi&quot; %>

<form name=&quot;forma&quot; method=&quot;post&quot; action=&quot;<%= url %>C_Rep_CostCenter_Summ.rpt&quot; target=&quot;crview&quot;>

<input type=&quot;hidden&quot; name=&quot;prompt0&quot; value=&quot;<%= prompt0 %>&quot;>


<%@ include file=&quot;FireFragmentD.lssi&quot; %>
<%@ include file=&quot;FireFragmentE.lssi&quot; %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top