Пример #1
0
        private async Task GenerateReport(Patient patient, string templatePath, string reportDir)
        {
            var report = new WordAPI(templatePath, reportDir + "/" + patient.Name.Replace(" ", "-") + ".docx", readOnly: false);

            report.GenerateReport(patient, reportDir);
            report.Close();
        }
Пример #2
0
        private MemoryStream GeneratePatientReport(Patient patient, ReportTemplate template)
        {
            var reportTemplatePath = template.FilePath;

            MemoryStream docStream = new MemoryStream(System.IO.File.ReadAllBytes(reportTemplatePath));

            using (var docEditor = new WordAPI(docStream, readOnly: false))
            {
                docEditor.GenerateReport(patient);
            }

            return(docStream);
        }