what 2 do in CrystalReport to accept the value which i am passing from jsp

hi,

I am doing Crystal Report with jsp..using Tomcat 5.x as server...and using CRX1 trial version

how can i pass parameter from jsp to Report(say Empl.rpt)?...what are the steps...

shall i have to do anything in crystal report (Empl.rpt) to accept the value which i am passing from jsp.....can u help me please....

am using this code....

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

<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>

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

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

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

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

<%

String report="/Empl.rpt";

IReportSourceFactory2 rptSrcFactory= new JPEReportSourceFactory();

IReportSource reportSource=(IReportSource)rptSrcFactory.createReportSource(report,request.getLocale());

Fields fields = new Fields();

ParameterField pfield1 = new ParameterField();

ParameterField pfield2 = new ParameterField();

Values vals1 = new Values();

Values vals2 = new Values();

ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();

pfield1.setReportName("");

pfield1.setName("EMP_ID");

String age=request.getParameter("age");

Integer Age = new Integer(age);

pfieldDV1.setValue(Age);

vals1.add(pfieldDV1);

pfield1.setCurrentValues(vals1);

fields.add(pfield1);

CrystalReportViewer viewer = new CrystalReportViewer();

viewer.setReportSource(reportSource);

viewer.setParameterFields(fields);

viewer.setEnableParameterPrompt(false);

viewer.refresh();

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

viewer.dispose();

%>

sujith.mohan@gmail.com

pvsm

[2113 byte] By [PVSMa] at [2007-10-2 6:57:55]
# 1

hi sujith,

Iam also facing the same problem, iam accepting a value from html and need to pass it to SQL query (using Add Command) in crystal report, iam unable to get the exact syntax for the query, and unable to understand how to pass the parameters. my code is similar to urs.

Thanx in advance

AliceAlicea at 2007-7-16 20:26:42 > top of Java-index,Core,Core APIs...
# 2
Dear All,I am facing the same problem with WEBLOGIC 8.1 I think the problem with parameter passing.Do you guys got it resolved?Please help me to resolve.Thanks in advance.pcsunil@yahoo.com
jagubaaia at 2007-7-16 20:26:42 > top of Java-index,Core,Core APIs...