如何将datatable中的数据输出到水晶报表中? 你把datagridview的数据源转换成datatable看下,还有你就是要确认你的数据源中是否有数据myReport.SetDataSource(datatable); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 到此处你看下数据源是否有值如果有可能是你没给保镖浏览器指定报表源文件下面偷阿泰段代码 ReportDocument myReport = new ReportDocument(); string reportPath = System.Threading.Thread.GetDomain().BaseDirectory + "crystalreport1.rpt"; myReport.Load(reportPath); //绑定数据集,注意,一个报表用一个数据集。 myReport.SetDataSource(dataSet); crystalReportViewer1.ReportSource = myReport; crystalReportViewer1.RefreshReport(); 这样看一下dataSet = new DataSet(); dt.tablename="跟水晶报表设计时的表名要一致";dataSet.Tables.Add(dt.Copy()); if (dataSet != null) { //myReport.SetDataSource(dataSet); myReport.SetDataSource(dataSet.Tables[0]); } this.crystalReportViewer1.ReportSource = myReport; 各位老大们啊我的dataset中的数据在数据库中的没有对应的表啊,是自己程序中逻辑计算出来的啊3,4,5楼的兄弟给的代码有什么用啊问题核心概括:dataset中的数据在数据库中的没有对应的表,如何设计水晶报表并通过水晶报表打印数据? 怎么定义一个ASCII值,在转换成16进制。 在把它作为命令发送给串口。 关于序列号验证和产品授权 360软件管家的动态桌面图标,如何实现 参数化查询的问题 怎么在webbrowser的焦点处插入图片 datagridview最后一个单元格选择enter新建一空行 正则表达式中如何排除头尾只留中间 拜托各位大大给我点c#里“递归”的资料 求耐心解释一正则 (?i)(?<=<td.*?.*?>)[^<]+(?=</td>) 如何在水晶报表中添加SQL表达式? 关于C#的函数问题 C#结构体问题
到此处你看下数据源是否有值
如果有
可能是你没给保镖浏览器指定报表源文件下面偷阿泰段代码 ReportDocument myReport = new ReportDocument();
string reportPath = System.Threading.Thread.GetDomain().BaseDirectory + "crystalreport1.rpt";
myReport.Load(reportPath); //绑定数据集,注意,一个报表用一个数据集。 myReport.SetDataSource(dataSet);
crystalReportViewer1.ReportSource = myReport;
crystalReportViewer1.RefreshReport();
dataSet = new DataSet();
dt.tablename="跟水晶报表设计时的表名要一致";
dataSet.Tables.Add(dt.Copy());
if (dataSet != null)
{ //myReport.SetDataSource(dataSet);
myReport.SetDataSource(dataSet.Tables[0]);
}
this.crystalReportViewer1.ReportSource = myReport;
我的dataset中的数据在数据库中的没有对应的表啊,是自己程序中逻辑计算出来的啊
3,4,5楼的兄弟给的代码有什么用啊
问题核心概括:
dataset中的数据在数据库中的没有对应的表,如何设计水晶报表并通过水晶报表打印数据?