public void PeriodLoadBrewsFromWorkSheetTestCase() { Period period = new XlPeriod("2018", "January", connectionString); period.LoadBrews(); Assert.AreEqual(2, period.Brews.Count); }
public XlReport(XlPeriod period, string reportName, string reportPath) { this.period = period; this.reportName = reportName; this.fileInfo = new FileInfo(reportPath + Path.DirectorySeparatorChar + reportName + ".xlsx"); xlBrewingFormWorksheet = period.XlBrewingFormWorksheet; templatePath = appSettings.ReportTemplateFilePath; this.template = new FileInfo(templatePath); CreateReportWorkSheet(); CopyParametersFromPeriod(); }
private void CopyParametersFromPeriod() { using (xlPackage = new ExcelPackage(fileInfo)) { XlPeriod xlPeriod = (BrewingModel.Datasources.XlPeriod)period; xlReportWorksheet = xlPackage.Workbook.Worksheets[reportWorksheet]; for (int column = 1; column <= xlPeriod.XlBrewingFormWorksheet.Dimension.Columns; column++) { for (int row = 1; row <= xlPeriod.XlBrewingFormWorksheet.Dimension.Rows; row++) { xlReportWorksheet.Cells[row, column].Value = xlPeriod.XlBrewingFormWorksheet.Cells[row, column].Value; } } xlPackage.Save(); } }
public override void CreateReport(string year, Month month, string reportName, string reportPath) { XlPeriod period = (XlPeriod)GetPeriod(year, month); report = new XlReport(period, reportName, reportPath); }
private void CreatePeriod() { datasource = new XlDatasource(connectionString, periodTemplateFilePath); period = (BrewingModel.Datasources.XlPeriod)datasource.CreatePeriod("2018", Month.September); }