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

Missing parameter values

Hello

We have a web application which uses Crystal reports 2008. This web application loads a report for the first time perfectly. This report expects one parameter and its being passed from the code (inside the OnInit Section). This report uses a storedprocedure to get data which expects a single parameter.

When the crystal viewer control is refreshed using the refresh button on the crystal tool bar it displays the error message "Missing parameter values".

Canu2019t figure out what we are doing wrong.

Any help in getting this sorted is really appreciated.

Thanks,

Sam

Code inside on Init --

crReportDocument = new SurveysByQuestionReport();

ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = "xxx.xxx.xxx";

connectionInfo.DatabaseName = "xxxx";

connectionInfo.UserID = "xxxx";

connectionInfo.Password = "xxxxxxxx";

//Get the tables collection from the report object

crDatabase = crReportDocument.Database;

crTables = crDatabase.Tables;

//Apply the logon information to each table in the collection

foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)

{

crTableLogOnInfo = crTable.LogOnInfo;

crTableLogOnInfo.ConnectionInfo = connectionInfo;

crTable.ApplyLogOnInfo(crTableLogOnInfo);

}

//Once the connection to the database has been established for

//each table in the report, the report object can be bound to the viewer

//using the reportsource property of the viewer to display the report.

CrystalReportViewer1.ReportSource = crReportDocument;

//Get the collection of parameters from the report

crParameterFields = CrystalReportViewer1.ParameterFieldInfo;

//Access the specified parameter from the collection

crParameterField = crParameterFields["@PackageId"];

crParameterValues = crParameterField.CurrentValues;

crParameterValues.Clear();

//Set the current values for the parameter field

ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

crParameterDiscreteValue.Value = "07B9B1FE-5CF6-4C74-801F-536DA6615C7D";

//Add the first current value for the parameter field

crParameterValues.Add(crParameterDiscreteValue);

//Set the modified parameters collection back to the viewer so that

//the new parameter information can be used for the report.

CrystalReportViewer1.ParameterFieldInfo = crParameterFields;

base.OnInit(e);

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 24, 2008 at 12:40 PM

    HI Samitha,

    Have you checked the viewer control and set the ReuseParameterValuesonRefresh to true? It is typically set to false by default.

    Jason

    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.