예제 #1
0
        public ActionResult DownloadForm(string appId)
        {
            obj = GetData();

            Microsoft.Reporting.WebForms.LocalReport rpt = new Microsoft.Reporting.WebForms.LocalReport();
            rpt.ReportPath = Server.MapPath(@"~/Aff_Reports/Rep_Affi_Ins_Visting_Member.rdlc");
            rpt.DataSources.Add(new ReportDataSource("AJ_Aff_Ins_Vist_Rep_Commety", db.AJ_Aff_Ins_Vist_Rep_Commety(Convert.ToInt32(appId))));
            rpt.DataSources.Add(new ReportDataSource("AJ_Aff_Ins_Vist_Rep_MEmBEr_Commety", db.AJ_Aff_Ins_Vist_Rep_MEmBEr_Commety(Convert.ToInt32(obj.Institute_Id))));

            byte[] bytes = rpt.Render("PDF");
            Response.Buffer = true;
            Response.Clear();
            Response.AddHeader("content-disposition", "attachment; filename= Application" + "." + "PDF");
            Response.OutputStream.Write(bytes, 0, bytes.Length); // create the file
            Response.Flush();                                    // send it to the client to download
            Response.End();
            //return View();
            //return Json("Secuss", JsonRequestBehavior.AllowGet);
            return(View());
        }