Example #1
0
        public void GeneratePatientReport(List <PatientReportModel> model, Refer ReferDoctor, Patient PatientInfo, UserEmployee PatientDoctor, string BranchName)
        {
            //StreamWriter sq = new StreamWriter(Server.MapPath("/images/") + "log.txt");
            //sq.Close();
            //StreamWriter sw = new StreamWriter(Server.MapPath("/images/") + "log.txt");
            //sw.WriteLine("patient report method start....");
            string filename = "Report-" + PatientInfo.Id + ".pdf";

            if (!System.IO.File.Exists(Request.MapPath("/PatientsReport/") + filename))
            {
                var path = Server.MapPath("/images/");
                // sw.WriteLine("condition true of patient report. file doesn't exist..");
                // sw.WriteLine("class going to instantiate report.");
                PatientReport Report = new PatientReport(path, model, ReferDoctor, PatientInfo, PatientDoctor, BranchName);
                //sw.WriteLine("report class instantiated");
                PdfDocument pdf = Report.CreateDocument();
                //sw.WriteLine("report is created.");

                pdf.Save(Server.MapPath("/PatientsReport/") + filename);
                //sw.WriteLine("report saved successfully");
                //    System.IO.FileInfo fi=new System.IO.FileInfo(Request.MapPath("/PatientsReport/") + filename);
                //    fi.Delete();
            }
            // ...and start a viewer.
            //sw.WriteLine("report process start.");
            Process.Start(Server.MapPath("/PatientsReport/") + filename);
            //sw.WriteLine("report PROCESS END");
            //sw.Close();
        }
Example #2
0
        public void GeneratePatientReport(List <PatientReportModel> model, Refer ReferDoctor, Patient PatientInfo, UserEmployee PatientDoctor, string BranchName)
        {
            string filename = "Report-" + PatientInfo.Id + ".pdf";

            if (!System.IO.File.Exists(Request.MapPath("/PatientsReport/") + filename))
            {
                var Path = Server.MapPath("/images/");

                PatientReport Report = new PatientReport(Path, model, ReferDoctor, PatientInfo, PatientDoctor, BranchName);

                PdfDocument pdf = Report.CreateDocument();


                pdf.Save(Server.MapPath("/PatientsReport/") + filename);
                //    System.IO.FileInfo fi=new System.IO.FileInfo(Request.MapPath("/PatientsReport/") + filename);
                //    fi.Delete();
            }
            // ...and start a viewer.
            Process.Start(Server.MapPath("/PatientsReport/") + filename);
        }