public ActionResult ISR030_GetRemoveSlipData(string strSlipNo) { IReportHandler reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler; List <RPTRemoveSlipDo> rptList = reportHandler.GetRptRemoveSlipReport(strSlipNo); IDocumentHandler dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler; List <tbm_DocumentTemplate> dLst = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_REMOVAL_INSTALL_SLIP); ReportDocument rptH = new ReportDocument(); //string path = ReportUtil.GetReportTemplatePath("Reports/ISR030_RemovalInstallationSlip.rpt"); string path = ReportUtil.GetReportPath("Reports/ISR030_RemovalInstallationSlip.rpt", Server.MapPath("/")); rptH.Load(path); List <RPTRemoveSlipDo> lst = new List <RPTRemoveSlipDo>(); if (rptList != null && rptList.Count > 0) { lst.Add(rptList[0]); if (dLst.Count > 0) { lst[0].DocumentNameEN = dLst[0].DocumentNameEN; lst[0].DocumentVersion = dLst[0].DocumentVersion; } } else { rptList.Add(new RPTRemoveSlipDo()); } rptH.SetDataSource(lst); rptH.Subreports["Page1"].SetDataSource(rptList); rptH.Subreports["Page2"].SetDataSource(rptList); Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); rptH.Close(); return(File(stream, "application/pdf")); }