如何把查询出来的datatale导出水晶报表

oxnanke 2010-10-09 11:10:11
请问各位,我通过三层架构里的一个操作类里查出了一个datatable dt=new StudentDAO().SelectAll()后,怎样把这个查询结果dt显示在水晶报表上
...全文
98 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
大飞飞虫 2010-10-09
  • 打赏
  • 举报
回复
*.rpt 设计时需要有DATASET做支持,
这个DATASET和你的DATATABLE栏位一样。
laichunlin 2010-10-09
  • 打赏
  • 举报
回复
ReportDocument myReport = new ReportDocument();
string reportPath = Server.MapPath("rptAttendance.rpt");
myReport.Load(reportPath);

myReport.SetDataSource(dt);
CrystalReportViewer1.ReportSource = myReport;
wuyq11 2010-10-09
  • 打赏
  • 举报
回复
ReportDocument myReport = new ReportDocument();
myReport.Load("crystalreport1.rpt");
myReport.SetDataSource( ds.Tables["表名"]);
http://topic.csdn.net/u/20090713/18/6e14bf28-1979-4ade-9c60-aaf09284553d.html

111,129

社区成员

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

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

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