예제 #1
0
        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);
            }
        }
예제 #2
0
        public ExcelTableReport(string reportName, IEnumerable <Doc> docs, BizTableReport reportData)
        {
            _report         = new ExcelReport(reportName, "Empty", "Отчет");
            _enumRepository = new EnumRepository();

            CreateReport(reportName, docs, reportData);
        }
예제 #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());
            }
예제 #5
0
 public ExcelTableReport(IExcelReport report, IEnumRepository enumRepository)
 {
     _report         = report;
     _enumRepository = enumRepository;
 }
예제 #6
0
 public ExcelDocListReport(IExcelReport report, IEnumRepository enumRepository)
 {
     _report         = report;
     _enumRepository = enumRepository;
 }