您的位置:首页 > 其它

reportViewer1报表打印

2008-06-18 11:10 225 查看
if (ds.Tables[0].Rows.Count > 0)
{
//为报表浏览器指定报表文件
reportViewer1.LocalReport.ReportEmbeddedResource = "Report1.rdlc";
//显示报表
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
reportViewer1.LocalReport.DataSources.Clear();
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1_ep01NEW", ds.Tables[0]);
reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
reportViewer1.LocalReport.Refresh();
reportViewer1.RefreshReport();
//CrystalReport1 report = new CrystalReport1();
//report.SetDataSource(ds);
//Form2 f2 = new Form2();
//f2.SetReportSouce(report);
//f2.Show();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: