reportviewer报表高手请进,一天未work out来的问题

GoodShot 2012-11-18 06:32:33

忙了一天的报表控件reportviewer,看了很多网上的方法,挨个测试了一遍,测试时网页均不显示数据。
下面是我最终的代码County_union_SectorTownTableAdapter是添加的数据集文件(.xsd)文件成的类,cus的GetData()得到的是表“County_union_SectorTown”的数据(这个做断点测试没有问题,能正常读取到记录)
ReportViewer1.LocalReport.ReportPath = Server.MapPath("Manage_city.aspx_report.rdlc");
County_union_SectorTownTableAdapter cus = new County_union_SectorTownTableAdapter();

Manage_city_report.County_union_SectorTownDataTable gvcr = cus.GetData(); ;

ReportDataSource rds = new ReportDataSource("County_union_SectionTown", gvcr);//这个引号的County_union_SectionTown是我随便起的名字,不知道跟这个又没有关系
this.ReportViewer1.LocalReport.DataSources.Add(rds);

ReportViewer1.DataBind();

ReportViewer1.LocalReport.Refresh();
...全文
140 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
goodshot 2012-11-22
  • 打赏
  • 举报
回复
设置一下reportviewer的报表源为空
dolking 2012-11-21
  • 打赏
  • 举报
回复
不能随便起名称,要数据集名_表名
阿邦_四月 2012-11-20
  • 打赏
  • 举报
回复
建議你用ODBC連接,用存儲過程形式做報表,就不存在此問題。

4,819

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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