private void ReportErrors(COBieWorkbook workbook, ICOBieValidationTemplate validationTemplate = null) { var errorsSheet = XlsWorkbook.GetSheet(ErrorsSheet) ?? XlsWorkbook.CreateSheet(ErrorsSheet); ICOBieSheetValidationTemplate sheetValidator = null; foreach (var sheet in workbook.OrderBy(w => w.SheetName)) { if (sheet.SheetName != Constants.WORKSHEET_PICKLISTS) { if (validationTemplate != null && validationTemplate.Sheet.ContainsKey(sheet.SheetName)) { sheetValidator = validationTemplate.Sheet[sheet.SheetName]; } // Ensure the validation is up to date sheet.Validate(workbook, ErrorRowIndexBase.RowTwo, sheetValidator); } WriteErrors(errorsSheet, sheet.Errors); } }
private void ReportErrors(COBieWorkbook workbook, ICOBieValidationTemplate ValidationTemplate = null) { ISheet errorsSheet = ExcelWorkbook.GetSheet(ErrorsSheet) ?? ExcelWorkbook.CreateSheet(ErrorsSheet); //if we are validating here then ensure we have Indices on each sheet //workbook.CreateIndices(); ICOBieSheetValidationTemplate SheetValidator = null; foreach (var sheet in workbook.OrderBy(w => w.SheetName)) { if (sheet.SheetName != Constants.WORKSHEET_PICKLISTS) { if (ValidationTemplate != null && ValidationTemplate.Sheet.ContainsKey(sheet.SheetName)) { SheetValidator = ValidationTemplate.Sheet[sheet.SheetName]; } // Ensure the validation is up to date sheet.Validate(workbook, ErrorRowIndexBase.RowTwo, SheetValidator); } WriteErrors(errorsSheet, sheet.Errors); } }
private void ReportErrors(COBieWorkbook workbook, ICOBieValidationTemplate ValidationTemplate = null) { ISheet errorsSheet = ExcelWorkbook.GetSheet(ErrorsSheet) ?? ExcelWorkbook.CreateSheet(ErrorsSheet); //if we are validating here then ensure we have Indices on each sheet //workbook.CreateIndices(); ICOBieSheetValidationTemplate SheetValidator = null; foreach(var sheet in workbook.OrderBy(w=>w.SheetName)) { if(sheet.SheetName != Constants.WORKSHEET_PICKLISTS) { if (ValidationTemplate != null && ValidationTemplate.Sheet.ContainsKey(sheet.SheetName)) { SheetValidator = ValidationTemplate.Sheet[sheet.SheetName]; } // Ensure the validation is up to date sheet.Validate(workbook, ErrorRowIndexBase.RowTwo, SheetValidator); } WriteErrors(errorsSheet, sheet.Errors); } }