我通过一个方法返回一个实体对象作为reportViewer的数据源。但是在 new ReportDataSource("SHOP_Model_printorder ", Proder);的时候出现“/”应用程序中的服务器错误。值不在预期的范围内。, 快点帮帮我啊
printorder Proder= get_printdate(28);//通过ID返回实体对象
//DataSet ds = GetDataSet();//GetDataSet()方法可能会得到空值
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(". ") + "\\report2.rdlc ";//RPStatEC.rdlc为要展现的报表
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SHOP_Model_printorder ", Proder));
printorder Proder= get_printdate(28);//通过ID返回实体对象
//DataSet ds = GetDataSet();//GetDataSet()方法可能会得到空值
this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(". ") + "\\report2.rdlc ";//RPStatEC.rdlc为要展现的报表
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SHOP_Model_printorder ", Proder));
解决方案 »
- click 事件
- 问一个关于My97DatePicker的问题
- Label如何跟随鼠标移动
- visual studio2005和sqlserver2005连接
- 那位仁兄推荐一本net教程,要经典的啊!呵,先谢
- 晕..查不出哪错了..语法错误 在查询表达式 'ID=__Page' 中
- 为什么用浏览器打开word文档会出一提示窗口,让我输入身份验证信息,这个设置在哪改?
- 如何把一段C#后台代码在项目中的每一个ASPX页面中执行?粘贴除外
- 多张二进制图,如何显示在一个页面上?
- 是否可以传递参数给用户控件(.ascx文件)?
- 如何更新Datatable 或者 dataset 的数据类型
- 【向ALL提问】问个奇怪的问题。。。
ReportDataSource构造函数的第二个参数有一定要求的。Value may be an instance of System.Data.DataTable, a System.Collections.IEnumerable value (for example, System.Data.DataView or System.Array), a System.Windows.Forms.BindingSource (for the Microsoft Windows Form control) or a System.Web.UI.IDataSource (for the ASP.NET server control).If this value is an instance of System.Collections.IEnumerable, all elements in the collection must be of the same type, and names of the public properties of the element (as retrieved by the System.ComponentModel.TypeDescriptor.GetProperties() method) must match the field names of the corresponding report data source.Value may also be an instance of System.Type. In this case, an instance of the supplied type is automatically created and added to an automatically created collection. If the type of Value is not any of the aforementioned types, it is added to an automatically created collection.
你的类是从哪里继承的?
要求是必须从这些类继承,或者实现接口 System.Data.DataTable, a System.Collections.IEnumerable value (for example, System.Data.DataView or System.Array), a System.Windows.Forms.BindingSource (for the Microsoft Windows Form control) or a System.Web.UI.IDataSource (for the ASP.NET server control).
If the type of Value is not any of the aforementioned types, it is added to an automatically created collection. 好像会自动创建一个Collection.