i have tried below code to print current record on crystal report.Report is generated when press button but report is blank printing. records not printing on crystal report what to do...?
- SqlConnection con = new SqlConnection(this.con);
- SqlDataAdapter sda = new SqlDataAdapter("Select * from S_TEST Where S_ID='" + txtidno.Text + "'", con);
- DataSet ds = new DataSet();
- sda.Fill(ds);
- ReportDocument rpd = new ReportDocument();
- rpd.Load(Server.MapPath("~/Report/studentpass.rpt"));
- rpd.SetDataSource(ds.Tables[0]);
- CrptViewer.ReportSource = rpd;
- rpd.PrintToPrinter(1, false, 0, 0);