C# Winform ReportView手动绑定数据之后在报表中不显示

yuandinxiaozhu 2012-04-07 11:48:36
我是使用报表向导新建的报表,把DataSet里的数据直接拖到行,列和值。不知道这个有没有关系的?
下面是手动绑定的代码
DataSet DataSet1 = new DataSet();
string select = "select * from Shippment_profits";
DataSet1 = bc.GetDataSet(select, "Shippment_profits");

ReportDataSource rds = new ReportDataSource("Shippment_profits", DataSet1.Tables["Shippment_profits"]);
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(rds);
this.reportViewer1.Refresh();
是不是漏了什么所以才显示不出来的?,还是漏了什么步骤?
有调试了,DataSet里面有数据的。谢谢!!!

下面这一句是系统自动生成的,用这一句就能看到数据。可是我现在要手动绑定,不要调用系统的
//TODO: 这行代码将数据加载到表“UNIONSKYDataSet.Shippment_profits”中。您可以根据需要移动或删除它。
this.Shippment_profitsTableAdapter.Fill(this.UNIONSKYDataSet.Shippment_profits);
this.reportViewer1.Refresh();
...全文
371 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuandinxiaozhu 2012-04-07
  • 打赏
  • 举报
回复
顶上!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
myceolzy 2012-04-07
  • 打赏
  • 举报
回复
this.reportViewer1.RefreshReport(); this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
yuandinxiaozhu 2012-04-07
  • 打赏
  • 举报
回复
怎么没有人!!!!!!!!!!!!!DDDDDDDDDDDDDDDDDDDD

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧