public ActionResult ISR090_GetRptInstallCompleteConfirmData(string strSlipNo) { strSlipNo = "401029201112043"; IReportHandler reportHandler = ServiceContainer.GetService <IReportHandler>() as IReportHandler; List <RPTInstallCompleteDo> rptList = reportHandler.GetRptInstallCompleteConfirmData(strSlipNo); IDocumentHandler dochandler = ServiceContainer.GetService <IDocumentHandler>() as IDocumentHandler; List <tbm_DocumentTemplate> dLst = dochandler.GetDocumentTemplateByDocumentCode(DocumentCode.C_DOCUMENT_CODE_INSTALL_COMPLETE_CONFIRM); ReportDocument rptH = new ReportDocument(); string path = ReportUtil.GetReportPath("Reports/ISR090_InstallCompleteConfirmData.rpt", Server.MapPath("/")); rptH.Load(path); List <RPTInstallCompleteDo> lst = new List <RPTInstallCompleteDo>(); int i = 0; foreach (RPTInstallCompleteDo rptDataRow in rptList) { lst.Add(rptDataRow); if (dLst.Count > 0) { lst[i].DocumentNameEN = dLst[0].DocumentNameEN; lst[i].DocumentVersion = dLst[0].DocumentVersion; } i++; } rptH.SetDataSource(lst); rptH.SetParameterValue("C_RENTAL_INSTALL_TYPE_REMOVE_ALL", RentalInstallationType.C_RENTAL_INSTALL_TYPE_REMOVE_ALL); rptH.SetParameterValue("C_SALE_INSTALL_TYPE_REMOVE_ALL", SaleInstallationType.C_SALE_INSTALL_TYPE_REMOVE_ALL); Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); rptH.Close(); return(File(stream, "application/pdf")); }