c# Crystal Report SetParameter question

  • Thread starter Thread starter Jason Huang
  • Start date Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top