Passing Parameter from C# window form to Crystal Report(.rpt
I want to know that how to send parameter from C# windows form to .rpt file(Crystal Report). For example If i write name in text box of windows form so this name should appear at top of the crystal Report Form. Please show me the code.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Neha SharmaRank #569 · 4.3K reputationPosted Jun 3, 2013, 4:20 AM EDT
it might be helpfull for you :
http://www.c-sharpcorner.com/Forums/Thread/77017/
William Anthony50 reputationPosted Jun 3, 2013, 11:42 PM EDT
ParameterField objParameterField;
objDiscreteValue = new ParameterDiscreteValue();
objDiscreteValue.Value = comboBox1.Text;
objParameterField = crystalReportViewer1.ParameterFieldInfo["@Name"];
objParameterField.CurrentValues.Add(objDiscreteValue);
crystalReportViewer1.ParameterFieldInfo.Add(objParameterField);
I have used this above code for setting Parameter but What to code in .rpt file or How to set in report file.
Thanks