Crystal Report Parameter Pass C# , C-sharp
ParameterField paramerterField = new ParameterField();
ParameterFields parameterFields = new ParameterFields();
ParameterDiscreteValue pdvReprint = new ParameterDiscreteValue();
private void setParameter()
{
string rep = "";
try
{
rep = Request.QueryString["Rep"].ToString();
}
catch (Exception ex)
{
rep = "";
}
if (rep != "")
{
paramerterField.ParameterFieldName = "@Reprint";
pdvReprint.Value = rep;
paramerterField.CurrentValues.Add(pdvReprint);
parameterFields.Add(paramerterField);
CrViewer.ParameterFieldInfo = parameterFields;
}
else
{
paramerterField.ParameterFieldName = "@Reprint";
pdvReprint.Value = "";
paramerterField.CurrentValues.Add(pdvReprint);
parameterFields.Add(paramerterField);
CrViewer.ParameterFieldInfo = parameterFields;
}
}