/**
* Stage one: the inputs a business user owns. The policy assumptions and,
* below them, the journal rule source — which event posts which metric.
* Both are plain cells, editable in the viewer.
*/
private Workbook policy() {
Workbook wb = Workbook.create();
Sheet sheet = wb.createSheet(POLICY);
title(sheet, 0, "Policy assumptions · edit any value, then run the next stage");
header(sheet, 1, "Assumption", "Value", "Notes");
for (int i = 0; i < ASSUMPTIONS.length; i++) {
row(sheet, 2 + i, ASSUMPTIONS[i]);
}
sheet.range(2, 0, 7, 0).setStyle(fill(IDENTITY, true));
sheet.range(2, 1, 3, 1).setStyle(fill(IDENTITY, false));
sheet.range(4, 1, 6, 1).setStyle(fill(IDENTITY, false, "#,##0"));
sheet.range(7, 1, 7, 1).setStyle(fill(IDENTITY, false, "0.00"));
title(sheet, RULE_TITLE_ROW, "Journal rule source · metrics are named, see the Metrics sheet");
header(sheet, RULE_HEADER_ROW, "Event", "Description", "Debit metric", "Credit metric");
for (int i = 0; i < JOURNAL_RULES.length; i++) {
row(sheet, RULE_HEADER_ROW + 1 + i, (Object[]) JOURNAL_RULES[i]);
}
sheet.range(RULE_HEADER_ROW + 1, 0, RULE_HEADER_ROW + JOURNAL_RULES.length, 3)
.setStyle(fill(RULE, false));
sheet.setColumnWidth(0, 26);
sheet.setColumnWidth(1, 46);
sheet.setColumnWidth(2, 26);
sheet.setColumnWidth(3, 26);
return wb;
}This demo follows a spreadsheet-driven financial reporting workflow. The same approach applies to many financial and regulatory reporting processes.
The Policy sheet holds the assumptions and the journal rule source: for each accounting event, the metric posted to the debit side and the metric posted to the credit side. Both are plain cells, and every stage reads the book on screen back into Axyra, so an edited premium or a changed rule is what the next stage works from.
The calculation belongs to the workbook rather than to Java. Each IFRS metric is a formula published
as a defined name, and each journal entry is generated as a formula naming the metric its rule asks
for, such as =principal_base. The Report Impact sheet compares each
line before and after the IFRS 9 / IFRS 15 split in the same way, and a balance check confirms that
debits equal credits.
Finally, the journal, the report and the metrics are copied as plain values into export-ready sheets, and the journal can be downloaded as a CSV file for a ledger import.