Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

How Can i print byte array asp.net *web application*

$
0
0
This is my code
 
 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;
        filetype = "PDF";
        fname = DateTime.Now.ToString("yyyyMMddHHmmssfff");
        byte[] bytes = rptvw1.LocalReport.Render(filetype, null, out mimeType, out encoding, out extension, out streamIds, out warnings);
finally am getting this format as byte array.
I want to print this byte array without saving any format.
Please tell me how to print this byte array directly.

Viewing all articles
Browse latest Browse all 3938

Trending Articles