Bhavesh Vankar

Bhavesh Vankar

  • 725
  • 1.1k
  • 78.7k

Print current Record

Jan 29 2021 7:07 AM
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...?
  1. SqlConnection con = new SqlConnection(this.con);  
  2.               SqlDataAdapter sda = new SqlDataAdapter("Select * from S_TEST Where S_ID='" + txtidno.Text + "'", con);  
  3.               DataSet ds = new DataSet();  
  4.               sda.Fill(ds);  
  5.               ReportDocument rpd = new ReportDocument();  
  6.               rpd.Load(Server.MapPath("~/Report/studentpass.rpt"));  
  7.               rpd.SetDataSource(ds.Tables[0]);  
  8.               CrptViewer.ReportSource = rpd;  
  9.               rpd.PrintToPrinter(1, false, 0, 0);  

Answers (2)