In rdlc report viewer page I have written the following codes. The report viewer name is "rvInLineRejectionStyleWise".
I add one table in dataset. Now I need to add two tables in the dataset. Please help me. Advance thanks for helping me.
DataTable dt = new DataTable();
rvInLineRejectionStyleWise.LocalReport.ReportPath = Server.MapPath("Smt_DefectWiseReport.rdlc");
SqlDataAdapter ad = new SqlDataAdapter("Smt_Defect_Wise_Report '" + strStyleCode + "'", cn);
DataSet ds = new DataSet();
ad.Fill(ds);
ReportDataSource rds1 = new ReportDataSource("DataSet1", ds.Tables[0]);
rvInLineRejectionStyleWise.LocalReport.DataSources.Clear();
rvInLineRejectionStyleWise.LocalReport.DataSources.Add(rds1);
I have write the code to add another dataset. It arise the error "An error occurred during local report processing."
DataTable dtest = new DataTable();
rvInLineRejectionStyleWise.LocalReport.ReportPath = Server.MapPath("Smt_DefectWiseReport.rdlc");
SqlDataAdapter adtest = new SqlDataAdapter("Smt_Defect_Category_Wise_Graph '" + strStyleCode + "'", cn);
DataSet dstest = new DataSet();
adtest.Fill(dstest);
ReportDataSource rds2 = new ReportDataSource("DataSet2", ds.Tables["dtest"]);
rvInLineRejectionStyleWise.LocalReport.DataSources.Clear();
rvInLineRejectionStyleWise.LocalReport.DataSources.Add(rds2);
I provide my rest of the code :
byte[] bytes = rvInLineRejectionStyleWise.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(bytes.ToArray());
Response.End();