0
我使用Access數據庫,VS2010,我試圖加載水晶報表,但得到這個錯誤此行裝載.rpt文件,什麼是錯的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;
}
如果File存在於同一個解決方案中,該怎麼辦? – Rahul
你能建議我嗎? – Rahul