Warning[] warnings; string[] streamIds; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; DataTable dt = new DataTable(); ReportViewer1.LocalReport.ReportPath = Server.MapPath("rptEmployeeDetailsReport.rdlc"); SqlDataAdapter ad = new SqlDataAdapter("Details_Report '" + AllCompany + "'", cn); DataSet ds = new DataSet(); ad.Fill(ds); ReportDataSource rds = new ReportDataSource("DataSet1", ds.Tables[0]); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); ReportParameterCollection reportParameters = new ReportParameterCollection(); reportParameters.Add(new ReportParameter("Company", ComName)); reportParameters.Add(new ReportParameter("Add1", cAdd1)); reportParameters.Add(new ReportParameter("Add2", cAdd2)); ReportViewer1.LocalReport.SetParameters(reportParameters); byte[] bytes = ReportViewer1.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();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)