c# Crystal Report SetParameter question

J

Jason Huang

Hi,

In my C# windows form project, it has a form frmReport and a crystal report
rptCustomer.
The rptCustomer has 2 parameters, CustID and CustName.
Saying now in my frmReport, I build a DataSet rDS on the runtime and it has
a DataTable MyTable which has data like this:

00000001 John Doe
00000002 Lio Smith
00000003 Mary Jordan

And this part of my code in frmReport:

for (int j=0; j<rDS.Tables["MyTable"].Rows.Count; j++)
{
rpt.SetParameterValue("CustID",rDS.Tables["MyTable"].Rows[j][0].ToString());
rpt.SetParameterValue("CustName",rDS.Tables["MyTable"].Rows[j][1].ToString());
}
crystalReportViewer1.ReportSource=rpt;

The result is in the rptCustomer it will show only the last data "0000003
Mary Jordan",
but the other record will not show up!
I am wondering how to let the other data "000000001 John Doe", "00000002 Lio
Smith" show up in the rptCustomer.
Thanks for help.


Jason
 
Top