111,130
社区成员
发帖
与我相关
我的任务
分享
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using System.Data;
partial class report_EmployeeView : System.Web.UI.Page
{
private void // ERROR: Handles clauses are not supported in C# Page_Load(object sender, System.EventArgs e)
{
try {
if (!IsPostBack) {
BindServer();
}
}
catch (Exception ex) {
}
}
}
private ReportDocument ReportDoc = new ReportDocument();
private void BindServer()
{
dbprocess.OledbProcess clsDBProcess = new dbprocess.OledbProcess();
DataSet ds = default(DataSet);
string strsql = null;
strsql = "select * from employee";
ds = clsDBProcess.GetDataSet(Session("Server"), Session("Database"), strsql);
ds.EnforceConstraints = false;
ReportDoc.Load(Server.MapPath("report\\Employee.rpt")); //Employee.rpt是一个空报表
ReportDoc.SetDataSource(ds.Tables(0));
this.CrystalReportViewer1.ReportSource = ReportDoc;
}
}
请问哪里错了?