public void CreateReport(IExcelReport report)
        {
            var templateFullpath = Path.Combine(Environment.CurrentDirectory, templateFilename);

            if (!File.Exists(templateFullpath))
            {
                throw new ApplicationException($"Файл-шаблон отчета не существует или не задан ({templateFullpath})");
            }

            try
            {
                using (var application = new Application())
                {
                    using (var workbook = application.Workbooks.Add(templateFullpath))
                    {
                        report.ExportToExcel(workbook);
                    }

                    application.Visible = true;
                }
            }
            catch (Exception ex)
            {
                throw new SystemException("Ошибка экспорта платежей ЭЭ в документ Excel", ex);
            }
        }
Example #2
0
        public ExcelTableReport(string reportName, IEnumerable <Doc> docs, BizTableReport reportData)
        {
            _report         = new ExcelReport(reportName, "Empty", "Отчет");
            _enumRepository = new EnumRepository();

            CreateReport(reportName, docs, reportData);
        }
Example #3
0
        public ExcelDocListReport(string reportName, IEnumerable <Doc> docs, Doc docTemplate)
        {
            _report         = new ExcelReport(reportName, "Empty", "Отчет");
            _enumRepository = new EnumRepository();

            CreateReport(reportName, docs, docTemplate);
        }
            DownloadFileInfo GetReportFileInfo(String reportCode)
            {
                IExcelReport report = ExcelReportAssembly.LoadReport(reportCode);

                report.Render();

                return(report.GetDownloadFileInfo());
            }
Example #5
0
 public ExcelTableReport(IExcelReport report, IEnumRepository enumRepository)
 {
     _report         = report;
     _enumRepository = enumRepository;
 }
Example #6
0
 public ExcelDocListReport(IExcelReport report, IEnumRepository enumRepository)
 {
     _report         = report;
     _enumRepository = enumRepository;
 }