Skip to Content
author's profile photo Former Member
Former Member

Parameter values cannot be passed into the report in Crystal Reports Server 2011 SP4


We tried to run crystal reports from a web application using RAS 2011 API as un-managed reports. On Crystal Reports Server 2011 SP2,

it runs perfect, however after we upgrade to CRS 2011 SP4, it looks like the parameters cannot be passed into the report. At the

runtime, Crystal prompts additional dialog to enter the parameter values. Here explains the code:


The first part is the initialization and connection (un-managed reports). It always works fine.

ReportClientDocument clientDoc = new ReportClientDocument();
ReportAppSession reportAppSession = new ReportAppSession();
reportAppSession.createService(
"com.crystaldecisions.sdk.occa.report.application.ReportClientDocument");
reportAppSession.setReportAppServer(theCorrectservername);

reportAppSession.initialize();

clientDoc.setReportAppServer(reportAppSession.getReportAppServer());
clientDoc.open(theCorrectReportName,OpenReportOptions._openAsReadOnly);
ReportServerControl control = new ReportServerControl();
control.setReportSource(clientDoc.getReportSource());


The second part is set parameters. These parameters are defined in the report template. Here is to change them with the runtime

values.

private void setParameter(HttpServletRequest request, ReportClientDocument clientDoc, Map connContext)
{
try {
Fields paramCollection = clientDoc.getDataDefController().getDataDefinition().getParameterFields();

int lo_index ;
for (int liCount = 0; liCount < paramCollection.size(); liCount++)
{
ParameterFieldDiscreteValue newDiscreteValue = new ParameterFieldDiscreteValue();
ParameterField ls_ParamToChange = (ParameterField) paramCollection.getField(liCount);
String ls_parameterName = paramCollection.getField(liCount).getName();

newDiscreteValue.setValue(request.getParameter(ls_parameterName));


ParameterField newParam = (ParameterField) ls_ParamToChange.clone(true);
newParam.getCurrentValues().removeAllElements();

newParam.getCurrentValues().add(newDiscreteValue);
ParameterFieldController paramController = clientDoc.getDataDefController().getParameterFieldController();
paramController.modify(ls_ParamToChange, newParam);
}

}catch(Exception exc)
{
exc.printStackTrace();
}
}


Finally to render the report results.

private void renderCR() throws Exception {
String uri = getBasePath() + "/reports/RMViewReport.jsp?windowId="+getController().getWindowId();
ReportClientDocument reportDoc = (ReportClientDocument) getWindowProperty("currentViewerObject");
if (reportDoc == null) return;

CrystalReportViewer viewer = new CrystalReportViewer();

String mUserName = (String) connContext.get(REPORTUSERID);
if(mUserName != null)
mUserName = mUserName.trim();

String mDBPassword = (String) connContext.get(REPORTPASSWORD);

IConnectionInfo connInfo1 = new ConnectionInfo();
connInfo1.setUserName(mUserName);
connInfo1.setPassword(mDBPassword);
ConnectionInfos connInfos = new ConnectionInfos();
connInfos.add(connInfo1);

viewer.setReportSource(reportDoc.getReportSource());
viewer.setDisplayPage(true);
viewer.setDisplayGroupTree(false);
viewer.setDisplayToolbar(true);
viewer.setOwnPage(true);
viewer.setEnableLogonPrompt(true);
viewer.setEnableParameterPrompt(true);
viewer.setHasRefreshButton(false);
viewer.setHasLogo(false);
viewer.setEnableDrillDown(false);
viewer.setURI(uri);
viewer.setDatabaseLogonInfos(connInfos);
viewer.processHttpRequest(request, response, getController().getServletContext(), null);
viewer.dispose();
}


The code runs fine on CRS 2011 SP2, where no additional dialog is needed. However in CRS 2011 SP4, it prompts a dialog asking for

parameter values. It also logs the following error.

Please look into the issue and provide some guidance. Hopefully it is a configuration issue. Thanks.


[11/4/13 12:13:34:932 EST] 00000046 SystemOut O 2013-11-04 12:13:34,932 ERROR [WebContainer : 14] - Unable to process listener
com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException: Missing parameter values.---- Error code:-2147217394

[CRSDK00000000] Error code name:missingParameterValueError
at com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException.throwReportSDKParameterFieldException

(ReportSDKParameterFieldException.java:98)
at com.crystaldecisions.proxy.remoteagent.ExceptionHelper.throwResultInfoException(ExceptionHelper.java:190)
at com.crystaldecisions.sdk.occa.report.application.ControllerBase.send(ControllerBase.java:208)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.sendRequest(ReportSource.java:1748)
at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(ReportSource.java:957)
at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(AdvancedReportSource.java:343)
at com.businessobjects.report.web.event.PageListener.renderContentLocally(PageListener.java:394)
at com.businessobjects.report.web.event.PageListener.getPage(PageListener.java:181)
at com.businessobjects.report.web.event.PageListener.updatePage(PageListener.java:123)
at com.businessobjects.report.web.event.UpdatePageEvent.processListener(UpdatePageEvent.java:47)
at com.businessobjects.report.web.event.ViewerBroadcaster.broadcast(ViewerBroadcaster.java:109)
at com.businessobjects.report.web.event.EventQueue.processEvents(EventQueue.java:53)
at com.businessobjects.report.web.component.ViewerContainer.processEvents(ViewerContainer.java:1403)
at com.businessobjects.report.web.WorkflowController.doEventProcessing(WorkflowController.java:353)
at com.businessobjects.report.web.WorkflowController.doLifecycle(WorkflowController.java:255)
at com.businessobjects.report.web.WorkflowController.doAsyncLifecycle(WorkflowController.java:106)
at com.crystaldecisions.report.web.viewer.CrystalReportViewerUpdater._processHttpRequest(CrystalReportViewerUpdater.java:61)
at com.crystaldecisions.report.web.ServerControl.processHttpRequest(ServerControl.java:345)
at com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet.doUpdate(CrystalReportViewerServlet.java:156)
at com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet.doPost(CrystalReportViewerServlet.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2013 at 10:56 PM

    Can anyone take a look at this issue and help diagnosis it? Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.