protected void lnkbtn_B_Click(object sender, EventArgs e) { try { GlobalConnection gc = new GlobalConnection(); PatientClass pc = new PatientClass(); DataTable dt = pc.SelectForViewPatientRecords_SpecificLetter_ForReport("B"); if (dt.Rows.Count > 0) { ltrMessage.Text = ""; ReportViewer1.Reset(); // OR Set Report Path ReportViewer1.LocalReport.ReportPath = HttpContext.Current.Server.MapPath("Report_Patient_OtherUserMaster.rdlc"); // Clear the Data Source ReportViewer1.LocalReport.DataSources.Clear(); // Set a DataSource to the report ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); ReportViewer1.DataBind(); // Refresh and Display Report ReportViewer1.LocalReport.Refresh(); } else { ltrMessage.Text = "No data found!"; ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.DataBind(); ReportViewer1.LocalReport.Refresh(); } } catch (Exception ex) { ltrMessage.Text = ex.Message; } }