我正在使用 access 数据库和 VS2010,我正在尝试加载水晶报告,但此行出现此错误,server
我应该如何编写这个有什么问题
rptDoc.Load(Server.MapPath("C:/Users/Monika/Documents/Visual Studio 2010/Projects/SonoRepo/SonoRepo/Report/PatientCrystalReport.rpt"));
为了server
代码
private void ViewReport_Load(object sender, EventArgs e)
{
ReportDocument rptDoc = new ReportDocument();
PatientDataset ds = new PatientDataset(); // .xsd file name
DataTable dt = new DataTable();
// Just set the name of data table
dt.TableName = "Patient Crystal Report ";
dt = getAllPatients(); //This function is located below this function
ds.Tables[0].Merge(dt);
//getting error here
// Your .rpt file path will be below
rptDoc.Load(Server.MapPath("C:/Users/Monika/Documents/Visual Studio 2010/Projects/SonoRepo/SonoRepo/Report/PatientCrystalReport.rpt"));
//set dataset to the report viewer.
rptDoc.SetDataSource(ds);
PatientCrystalReport.ReportSource = rptDoc;
}