Click here to Skip to main content
15,885,213 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
How to pass parameters in sap crystal reports & VS2010.
I passed parameters like below

1.Report.SetParameterValue("ExpiryDate", Convert.ToDateTime(Session["ExpiryDate"].ToString()));

or

ParameterDiscreteValue paramDV = new ParameterDiscreteValue();
paramDV.Value = Convert.ToDateTime(Session["ExpiryDate"]);
NPR.ParameterFields["@ExpiryDate"].CurrentValues.Clear();
NPR.ParameterFields["@ExpiryDate"].DefaultValues.Clear();
NPR.ParameterFields["@ExpiryDate"].CurrentValues.Add(paramDV);

but both ways i got error(missed parameter values).

Thanks,
Posted
Updated 17-Oct-12 2:11am
v2

This problem can be solved in 2 steps
Step 1. In Report File add parameter as @ExpiryDate

Step 2. Give the same name as you have given in Report (~.rpt) file.

The error is occurring cos you have missed 1 step

If still not resolved I may send you a sample solution . :)
 
Share this answer
 
Can you please add sample code for this?
 
Share this answer
 
Comments
CHill60 26-Mar-15 7:55am    
Please don't post questions as solutions to old posts. If you want to respond to a solution use the "Have a Question or Comment?" link next to it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900