i have used below code to print current record but getting error "Report Load Faild" kindly guide me where is mistake. i am loading this method in save button after ExcecuteNonQuery.
- private void PrintReport()
- {
- SqlConnection con = new SqlConnection(this.con);
- SqlDataAdapter sda = new SqlDataAdapter("Select * from S_TEST Where S_ID='" + TxtAutovID.Text + "'", con);
- DataSet ds = new DataSet();
- sda.Fill(ds);
- ReportDocument rpd = new ReportDocument();
- rpd.Load(Server.MapPath("~/studentpass.rpt"));
- rpd.SetDataSource(ds.Tables[0]);
- CrptViewer.ReportSource = rpd;
- rpd.PrintToPrinter(1, false, 0, 0);
- }