Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue1001 #1002

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading