Report Templates
Report Templates
Reports in Rev79 take their structure from report templates. These XML documents define sections, layout, and input elements, from which Rev79 creates an editing UI and exported documents.
A Relax NG Compact Schema is exposed by Rev79, which can be used in tools such as the vscode-xml extension from Red Hat and Emacs' nXML Mode.
Basic Structure:
<report-template>
<introduction>
<title>Report Title</title>
<subtitle>Report Description</subtitle>
</introduction>
<section>
<heading>Section Title</heading>
<p>Description text</p>
<!-- Content goes here -->
</section>
</report-template>
Structural Elements:
<introduction>
Defines the report header with title and subtitle that appear at the beginning of the report.
<title> and <subtitle>
Used within <introduction> to set the main title and descriptive subtitle of the report.
<section>
Defines a major section of the report. Supports api and export attributes:
- api="no": Excludes section from API responses
- export="no": Excludes section from exported documents
Data Storage Mechanisms:
Rev79 uses two different mechanisms for storing and retrieving data in report templates:
name Attribute
Stores data directly against the report in a key/value store. The name serves as the key for storing and retrieving responses.
<input type="rich-text" name="project-impact" />
<input type="single-select" name="report-period">
<option id="Jan-Jun">Jan-Jun</option>
<option id="Jul-Dec">Jul-Dec</option>
</input>
field Attribute
Evaluates expressions in the report context, allowing access to project and report data through dot notation. These connect to the underlying data model.
<input type="short-text" field="project.funding_code" />
<input type="month" field="project.end_month" />
Common field expressions:
- project.name - Project name
- project.location - Project location
- project.start_month - Project start date
- project.end_month - Project end date
- report.approval_date - Report approval date
Input Types:
short-text: Single-line text inputlong-text: Multi-line text arearich-text: Rich text editor with formattingsingle-select: Dropdown with one selectionmulti-select: Dropdown with multiple selections
<table>
<row>
<cell border="white">
Is there any need for changes to the project outcomes? Explain what needs to change and why.
<input type="rich-text" name="changes-project-outcomes" />
</cell>
</row>
</table>
<row>
<cell border="white">
If you responded "Hard", please share with us the hardest steps in filling in the Quarterly Report, so we can try to improve these:
<input type="long-text" name="2-rev79-qr-hardest-steps"/>
</cell>
</row>
<row>
<cell border="white">
Select any options that are applicable.<br/>Filling in the Quarterly Report in Rev79 is:
<input type="multi-select" name="1-rev79-qr-feedback-multiselect">
<option id="Easy">Easy for me</option>
<option id="Useful">Useful to me</option>
<option id="Hard">Hard for me</option>
<option id="Not Useful">Not useful to me</option>
</input>
</cell>
</row>
Data Components:
<fixed-table code="FT###" />: Pre-defined system tables<data-grid code="DG###" />: Interactive data grids<progress-report />: Progress reporting component<activity-report />: Activity tracking component<outcome-report />: Outcome reporting component<plan-report />: Planning component<email-report />: Email submission component
Available Fixed Tables:
| Code | Description |
|---|---|
| FT002 | Goals Progress |
| FT003 | Progress on Outputs/Goals |
| FT004 | Plans for Next Quarter |
| FT006 | Project Details |
| FT011B | Impact Stories |
| FT018B | Photos |
| FT020 | Person’s Data |
| FT022 | Reporting Relationships |
| FT023 | Review and Evaluation |
| FT026 | Included Goals and Communities |
| FT038 | Key Results Areas (KRAs) |
Fixed Table Example:
<section>
<heading>Project Details</heading>
<fixed-table code="FT006" />
</section>
Available Data Grids:
| Code | Description |
|---|---|
| DG005 | Partners |
| DG019 | Translation Progress Chart |
| DG020 | Stories Chart |
| DG021 | Report Information |
| DG022B | Prayer |
| DG023 | Project Environment |
| DG092A | Outcomes Report |
| DG123 | Other Attachments |
Data Grid Example:
<section export="no">
<heading>Translation Progress Chart</heading>
<data-grid code="DG019" />
</section>
Table Structure:
<table>
<row>
<cell border="white">
<bold>Header Text</bold>
<italic>Italic text</italic>
Content and inputs
</cell>
</row>
</table>
Note on Feature Flags:
The feature-flag attribute on report elements is an internal Rev79 system tag that can be used to hide/show elements based on the state of Rev79's internal feature flags. You should not set this attribute without specific instruction from the Rev79 team.
Example Template:
<report-template>
<introduction>
<title>Project Progress Report</title>
<subtitle>Quarterly reporting template</subtitle>
</introduction>
<section>
<heading>Project Details</heading>
<fixed-table code="FT006" />
</section>
<section>
<heading>Stories and Learning</heading>
<table>
<row>
<cell border="white">
<bold>Project Impact</bold>
</cell>
</row>
<row>
<cell border="white">
Describe the project's impact on the community.
<input type="rich-text" name="project-impact" />
</cell>
</row>
</table>
</section>
<section api="no">
<heading>Outcomes report</heading>
<data-grid code="DG092A" />
</section>
<section export="no">
<heading>Finish</heading>
<email-report/>
</section>
</report-template>
Validation
Validate your XML template against the Rev79 schema using Jing:
# Download the schema
wget https://api.rev79.app/xml-schemas/report-template.rnc
# Validate your template
java -jar jing.jar -c report-template.rnc your-template.xml
Download Jing from relaxng.org. Valid templates produce no output; errors show line numbers and descriptions.