C#怎么把水晶报表显示在crystalReportViewer控件中

2024-11-17 00:17:57
推荐回答(2个)
回答(1):

确认.rpt文件在当前目录下,ReportSource指向报表对象实例,如
this.crystalReportViewer1.ReportSource=this.CrystalReport1

回答(2):

ReportDocument rd = new ReportDocument();
rd.Load(Application.StartupPath + "\\rptCancelin.rpt");
rd.SetDataSource(datatable);
crystalReportViewer1.ReportSource = rd;