Skip to Content
Former Member
Apr 23, 2012 at 08:01 PM

Opening a Crystal Report with parameter value supplied by the user



I have a crystal report with a parameter. I want to open this report in JSP with the parameter value supplied by the user. Basically these are the 2 steps:

1) When user try to open the report, a parameter window opens asking for user to enter value and press ok.

2) On pressing ok, the report will show using the parameter value user supplied.

The Step 1 is done and parameter window opens asking me to enter parameter value. When I enter parameter value and press ok, the parameter window opens again asking me to enter parameter value again. This is the code:

ReportClientDocument clientDoc = new ReportClientDocument();clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);, OpenReportOptions._openAsReadOnly);CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);CRJavaHelper.logonDataSource(clientDoc, userName, password);CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();crystalReportPageViewer.setReportSource(clientDoc.getReportSource());crystalReportPageViewer.processHttpRequest(request, response, application, null); 

I can run the reports without parameter perfectly. Its only the reports with one or more parameters which are having problems. Is there something missing? Somehow CRJ (Crystal Reports Java) is not using the parameter value entered by the user.