Skip to content

Commit

Permalink
Merge pull request #1002 from AtlasOfLivingAustralia/feature/issue1001
Browse files Browse the repository at this point in the history
Feature/issue1001
  • Loading branch information
chrisala authored Aug 28, 2024
2 parents 438efd1 + 241d8b4 commit c8d39b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,31 +439,31 @@ class ValidationHandler implements OutputModelProcessor.Processor<ExcelValidatio
def text(Object node, ExcelValidationContext context) {
if (node.constraints) {
List constraints = []

if (node.constraints instanceof Map && node.constraints.type == 'computed') {
constraints = node.constraints.options?.collect{it.value}?.flatten()?.unique()
}
else {
constraints = node.constraints
}
constraints.eachWithIndex { value, i ->
Row row = context.validationSheet.getRow(i)
if (!row) {
row = context.validationSheet.createRow(i)
if (node.constraints instanceof Map == false || node.constraints instanceof Map && node.constraints.type != 'pre-populated') {
if (node.constraints instanceof Map && node.constraints.type == 'computed') {
constraints = node.constraints.options?.collect{it.value}?.flatten()?.unique()
}
Cell cell = row.createCell(context.currentColumn)
cell.setCellValue(value)
}
def colString = CellReference.convertNumToColString(context.currentColumn)
def rangeFormula = "'${context.validationSheet.getSheetName()}'!\$${colString}\$1:\$${colString}\$${constraints.size()}"

DataValidationHelper dvHelper = context.currentSheet.getDataValidationHelper();
DataValidationConstraint dvConstraint =
dvHelper.createFormulaListConstraint(rangeFormula)
else {
constraints = node.constraints
}
constraints.eachWithIndex { value, i ->
Row row = context.validationSheet.getRow(i)
if (!row) {
row = context.validationSheet.createRow(i)
}
Cell cell = row.createCell(context.currentColumn)
cell.setCellValue(value)
}
def colString = CellReference.convertNumToColString(context.currentColumn)
def rangeFormula = "'${context.validationSheet.getSheetName()}'!\$${colString}\$1:\$${colString}\$${constraints.size()}"

DataValidationHelper dvHelper = context.currentSheet.getDataValidationHelper();
DataValidationConstraint dvConstraint =
dvHelper.createFormulaListConstraint(rangeFormula)

addValidation(node, context, dvConstraint)

addValidation(node, context, dvConstraint)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ class ProjectXlsExporter extends ProjectExporter {
List<String> rdpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Project Outcome/s", "Total to be delivered","2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"]
List<String> rdpSTProperties=commonProjectProperties +["service", "targetMeasure", "relatedOutcomes", "total", "2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"]

List<String> rlpSTProperties=commonProjectProperties +["service", "targetMeasure", "total", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "targetDate" ]
List<String> rlpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Total to be delivered", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "Target Date"]
List<String> rlpSTProperties=commonProjectProperties +["service", "targetMeasure", "relatedOutcomes", "total", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "targetDate" ]
List<String> rlpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Project Outcome/s", "Total to be delivered", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "Target Date"]

List<String> rlpKeyThreatHeaders =commonProjectHeaders + ['Key threats and/or threatening processes', 'Interventions to address threats']
List<String> rlpKeyThreatProperties =commonProjectProperties + ['keyThreat', 'keyTreatIntervention']
Expand Down

0 comments on commit c8d39b1

Please sign in to comment.