views:

13

answers:

0

Hello Friends, I am working with crystal report 2008

I have a Parameter Field named HeaderColumn1, whose value I want to pass programmatically.

I set the parameter field value with following code:

ReportDocument reportDocument = new ReportDocument();
ParameterFields paramFields = new ParameterFields;
ParameterField paramField;
ParameterDiscreteValue paramDiscreteValue;

paramField = new ParameterField();
paramField.Name = "HeaderColumn1";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Customer Code";
paramField.CurrentValues.Add(paramDiscreteValue);


paramFields.Add(paramField);

crystalReportViewer1.ReportSource = reportDocument;
crystalReportViewer1.ParameterFieldInfo = paramFields;
crystalReportViewer1.RefreshReport();

On running this code, it prompts for the ParameterValue of HeaderColumn1 parameter.

Why so ? Any solutions or suggestions ? Thanks a ton in advance.

:))