// GET: Print public ActionResult PrintOpdSlip(string opdId) { try { var reportData = OpdService.GetOpdById(opdId); var rd = new ReportDocument(); rd.Load(Path.Combine((Server.MapPath("~/Reports/opdReceipt.rpt")))); rd.SetDataSource(new List <OpdSlipReportModel> { new OpdSlipReportModel { Name = reportData.Name, DateTime = reportData.DateTime.ToString(), Amount = reportData.DocFee, DoctorName = reportData.DocName, RecievedBy = Session["userFirstName"].ToString(), TokenNo = reportData.DailyNo.ToString(), Age = reportData.Age, PatientId = reportData.PatientNo, VisitNo = reportData.VisitNo ?? 0 } }); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); var stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "application/pdf", reportData.Name + "_" + reportData.PatientNo + ".pdf")); } catch (Exception excep) { } return(null); }
public ActionResult CreateLabFromOpd(string opdId) { var patient = OpdService.GetOpdById(opdId); var model = new AddLabToPatientResponseModel { PatientInfo = new App_PatientLab { // ReportedOn = DateTime.Now.ToString(), RequestedOn = DateTime.Now.ToString(), Name = patient.Name, GuardianName = patient.GuardianName, Phone = patient.Phone, Address = patient.Address, PatientNo = opdId, Gender = patient.Gender, Age = patient.Age, MaritalStatus = patient.MartialStatus } }; return(View("PatientLabDetails", model)); }