I don'n have any report in my form ...

Aug 17 2006 8:13 AM
Hi All ,
In Form1 I've a CheckBox Control . I droped A CrystalReportViewer and ReportDocument in Form1.
I want to take a Report to show all of the Records' specified field(for e.g. :"firstname") , when I checked the CheckBoxControl . I Wrote this in btnShowReport_Click:

string query = "select * from TestReport";

sqlconn.Open();

da = new SqlDataAdapter(query, sqlconn);

SqlCommandBuilder scb = new SqlCommandBuilder(da);

da.Fill(DS.TestReport);//DS is a DataSet object .

myCrystalReport1.SetDataSource(DS);

//-----------------

ParameterField paramfield = new ParameterField();

ParameterFields paramfields = new ParameterFields();

ParameterDiscreteValue discreteval = new ParameterDiscreteValue();

paramfield.Name = "myfirstname";

discreteval.Value = "10";

paramfield.CurrentValues.Add(discreteval);

paramfields.Add(paramfield);

crystalReportViewer1.ParameterFieldInfo = paramfields;

//-----------------

crystalReportViewer1.ReportSource = myCrystalReport1;

crystalReportViewer1.Refresh();

sqlconn.Close();

and I create a parameter in report :"myfirstname" and in Formula editor , I wrote this :
if {?myfirstname}="10" then {TestReport.firstname} = {?myfirstname}
Now , I want to say :
1 - how can i use this variable (myNumber) in Form1.cs .
2 - I want to be shown all of the record firstname field ,how can i do it in :
discreteval.Value = ???????????????????
thanks for any help .
Regards ,