日期:2014-05-20  浏览次数:20376 次

asp.net2005中的web项目使用reportviewer控件连接rdlc报表,怎么传参数
asp.net2005中的web项目使用reportviewer控件连接rdlc报表,而数据集xsd是使用创建向导建立的,里面的select     sql语句是这样:    
select     *     from     ddmb     where     dw=@dw     and     year_month=@year_month    
可是这两个参数怎么传进来阿?

还有怎么动态添加数据集,就是不使用创建向导建立,用代码建立?


------解决方案--------------------
我是用objectdatasource来传参数的
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath( "Reports/ContractQuery.rdlc ");
ObjectDataSource ods = new ObjectDataSource( "MDCLib ", "QueryContract ");
QueryStringParameter para = new QueryStringParameter( "QueType ", TypeCode.String, "reportid ");
para.DefaultValue = "0 ";
ods.SelectParameters.Add(para);
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource( "mdc_ExpireContract_MDC_ExpireContract ", ods));
------解决方案--------------------
不顶不行!
------解决方案--------------------
帮顶来了,学习一下
------解决方案--------------------
qq:526585993