Page p = new Page(); string fname = string.Empty; string filetype = string.Empty; ReportViewer rptvw1 = new ReportViewer(); rptvw1.ProcessingMode = ProcessingMode.Local; rptvw1.LocalReport.ReportPath = p.Server.MapPath("~/GridReport.rdlc"); BL_Insurance.PrintDetail print = new BL_Insurance.PrintDetail(); DataTable ds = print.Print(Convert.ToInt32(p.Session["transactionid"]), Convert.ToString(p.Session["typeofplan"]), Convert.ToInt32(p.Session["UserID"])); ReportDataSource datasource = new ReportDataSource("DataSet1", ds); rptvw1.LocalReport.DataSources.Clear(); rptvw1.LocalReport.DataSources.Add(datasource); ReportParameter[] param = new ReportParameter[4]; param[0] = new ReportParameter("Company", Convert.ToString(p.Session["insurancecompany"])); param[1] = new ReportParameter("Policy", Convert.ToString(p.Session["policyname"])); if (ds.Columns.Contains("Adult")) { param[2] = new ReportParameter("Adult", "True"); param[3] = new ReportParameter("Child", "True"); } else { param[2] = new ReportParameter("Adult", "False"); param[3] = new ReportParameter("Child", "False"); } rptvw1.LocalReport.SetParameters(param); rptvw1.LocalReport.Refresh(); Warning[] warnings = null; string[] streamIds = null; string mimeType = string.Empty; string encoding = string.Empty; string extension = string.Empty; string fileNameExtension; filetype = "pdf"; byte[] bytes = rptvw1.LocalReport.Render(filetype, null, out mimeType, out encoding, out extension, out streamIds, out warnings);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)