private void GetReportInfo(ISheetBuilder sb, string reportName, Run run, DateTime reportDate) { sb.Column(1, cb => cb.Width(20)) .Column(2, cb => cb.Width(35)) .Block(bb => { bb.Add("Report Date").Style(GamePlanReportStyles.HeaderStyle.Name); bb.Add(reportDate.ToString(DateTimeFormat)).Style(GamePlanReportStyles.HeaderStyle.Name); }) .Block(bb => { bb.Add("Report Name").Style(GamePlanReportStyles.LightHeaderStyle.Name); bb.Add(reportName).Style(GamePlanReportStyles.LightHeaderStyle.Name); }) .Block(bb => { bb.Add("Run Name").Style(GamePlanReportStyles.LightHeaderStyle.Name); bb.Add(run.Description).Style(GamePlanReportStyles.LightHeaderStyle.Name); }) .Block(bb => { bb.Add("Run Id").Style(GamePlanReportStyles.LightHeaderStyle.Name); bb.Add(run.Id).Style(GamePlanReportStyles.LightHeaderStyle.Name); }); if (run.ExecuteStartedDateTime.HasValue) { sb.Block(bb => { bb.Add("Run Execute Date").Style(GamePlanReportStyles.LightHeaderStyle.Name); bb.Add(run.ExecuteStartedDateTime.Value.ToString(DateTimeFormat)).Style(GamePlanReportStyles.LightHeaderStyle.Name); }); } }
private void WriteNoDataRow(ISheetBuilder sb, int maxColumnCount) { var cell = new ExcelReportCell { Value = "No data", Alignment = ExcelHorizontalAlignment.Center, StyleName = GamePlanReportStyles.EmptyCellStyle.Name }; sb.Block(bb => { writeCell(bb, cell, maxColumnCount); }); }
private void WriteRow(ISheetBuilder sb, ExcelReportGrid grid, ExcelReportRow row) { sb.Block(bb => { for (var i = 0; i < row.Cells.Count; i++) { var cell = row.Cells[i]; var colSpan = 1; if (i > 0) { colSpan = (grid.MaxColumnCount - 1) / (row.Cells.Count - 1); } writeCell(bb, cell, colSpan); } }); }