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;
} }请问哪里错了?
路径换一下
不做任何设置。。当然不行。他没那么智能。在之前你的帖子里我一直对你所说的“空报表”不大理解,要是你什么都不设
也不连库,也不加ds,当然是不行的。你看下这个视频,照着做一下,再回头看你的项目吧。
http://www.cnblogs.com/babyt/archive/2008/11/19/1336469.html