水晶报表中的数据未支付 [英] Data Not dispaying in crystal report

查看:54
本文介绍了水晶报表中的数据未支付的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ReportDocument repdoc = new ReportDocument();
    DataSet1 ds = new DataSet1();
    DataTable dt = new DataTable();
       
    dt.TableName = "Attendance_Master";
    SqlDataAdapter adap = new SqlDataAdapter("select * from Attendance_Master", con);
    adap.Fill(ds);
     ds.Tables[0].Merge(dt);
     repdoc.Load(Server.MapPath("CrystalReport.rpt"));

     repdoc.SetDataSource(ds);
     CrystalReportViewer1.ReportSource = repdoc;


我做了类似上面的代码,但是数据没有显示在Web应用程序中.
如果某个地方我错了,请放手.


I did code something like above but data is not displaying in a web application.
Please let if I am wrong somewhere.

推荐答案

昨天我已经回答了类似的问题.

好,尝试我的建议....


  • 验证报告中的数据库
  • 确认您在数据集中或数据表中有数据
  • 为数据集&数据表与报表中的数据相同.
  • 如果报表中的表名称为Table1,则您的代码应如下所示.
Yesterday I have answered similar question.

OK Try my suggestions....


  • Verify database in the report
  • Confirm you have data in the dataset or datatable
  • Give the name for Dataset & Datatable same as in the report.
  • If the table name is Table1 in report then your code should be like below.
DataTable dt = new DataTable("Table1");


与数据集也相同.
如果报表中的数据集名称为Dataset1,则您的代码应如下所示.


Also the same to dataset.
If the dataset name is Dataset1 in report then your code should be like below.

DataSet ds = new DataSet1("Dataset1");



更改此行:
Change this line:
repdoc.SetDataSource(ds);






to

repdoc.SetDataSource(ds.Tables[0]);


这篇关于水晶报表中的数据未支付的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆