Click to See Complete Forum and Search --> : Invalid parameter name: {0} in crystal Report


saravanan.navaneethan
March 6th, 2006, 11:12 PM
hi,

I'm working crystal report XI with jsp.I have created empty rpt file from stored procedure.I want to create dynamic runtime report using pass the parameter to that rpt file through My JSP File.I will paste the JSP file which will set the parameter to the rpt file.

<%
/*
* Applies to: XI Release 2.
* Date Created: December 2005.
* Description: This sample demonstrates to how to launch a report in the Crystal Report DHTML viewer (CrystalReportViewer).
* NOTE: The CrystalReportViewer is kept on this special viewer page as the viewer also will 'post-back' during
* a viewer event such as page navigation, drill down, or launching other toolbar commands. The viewer
* then renders a new 'view' of the report source object previously created before calling this page and stored in session.
* Author: CW
*/
%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%//Crystal Report Viewer imports.%>
<%@page import="com.crystaldecisions.report.web.viewer.*"%>
<%@page import="com.crystaldecisions.reports.sdk.*" %>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.*,com.crystaldecisions.sdk.occa.report.data.*,com.crystaldecisions.sdk.occa.report.reportsource.*" %>


<%

//Refer to the Viewers SDK in the Java Developer Documentation for more information on using the CrystalReportViewer
//API.
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setOwnPage(true);
viewer.setOwnForm(true);
viewer.setPrintMode(CrPrintMode.ACTIVEX);

// set credentials information
ConnectionInfo ci = new ConnectionInfo();
ci.setUserName("kse2");
ci.setPassword("kse2");
ConnectionInfos connections = new ConnectionInfos();
connections.add(ci);
viewer.setDatabaseLogonInfos(connections);

// Passing parameters
Fields fields = new Fields();
ParameterField param = new ParameterField();
param.setReportName("");

param.setName("ICODE");
param.setName("IMARKETSEGMENTID");

Values vals = new Values();
ParameterFieldDiscreteValue val = new ParameterFieldDiscreteValue();
val.setValue(new Integer(0));
val.setValue(new Integer(1));

vals.add(val);
param.setCurrentValues(vals);
fields.add(param);
viewer.setParameterFields(fields);

//Get the report source object that this viewer will be displaying.
Object reportSource = session.getAttribute("reportSource");
viewer.setReportSource(reportSource);

//Render the report.
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);

%>

this is that JSP File .

When i call this file i'm getting Invalid Parameter Name{0} in Crystal Report Viewer.

If any body met the suituation.Please help me.It's Very Urgent.

thanks,
N.Saravanan.

mraasch
April 4th, 2006, 11:52 AM
Were you able to find a resolution to this issue?

I'm having the same problem and Business Objects has not heard of this problem before.

Thanks,
Mark