.Net2003调用数据源为存储过程的水晶报表的问题?
在.Net2003下,拉出此存储过程 到Form上可以调用,
反之不可以。例子如下:
private void Form_load(object sender, System.EventArgs e)
{
string strcustomer="ANATR"; //this.sqlCommand1.Parameters["@customerID"].Value=strcustomer;
ReportDocument rptByDate=new ReportDocument();
rptByDate.Load("D:\\Customer.rpt");
this.crystalReportViewer1.ReportSource=rptByDate;
}
以上用this.sqlCommand1.Parameters["@customerID"].Value=strcustomer;可以,问:我可不可以不用他,而用rptByDate.SetParameterValue("customerID", strcustomer);来传值给报表,因为水晶报表会把存储过程中的参数转化为报表的参数字段,但我试了不行,不知道为什么?