You can generate data-driven OpenDocument reports from a ViewModel when you need Word-compatible text documents or spreadsheet output in an MDriven application.
Start here
Use Training:Microsoft office and OpenDocument as a Report generator for the complete, step-by-step procedure for creating an OpenDocument template, preparing the report ViewModel, supplying template and output-file information, adding tags, and running the report.
For example, you can create a rent-bill report rooted in a billable period. The report ViewModel can expose the apartment number, rent, start date, and end date; the OpenDocument template then uses the ViewModel's report tags to place those values in the generated document.
Choose the right guidance
| If you need to... | Read |
|---|---|
| Create an .odt text report or .ods spreadsheet report from a template | Training:Microsoft office and OpenDocument as a Report generator |
Understand template retrieval, tag discovery with %meta%, ODT/ODS behavior, number handling, and template-editing limitations
|
Documentation:OpenDocument |
| Create and open a generated report from an OCL or EAL action | Documentation:OCLOperators opendocumentreportshow |
| Receive the generated report as binary data rather than opening it | Documentation:OCLOperators opendocumentreportasblob |
| Follow the report walkthrough in the MDriven Designer learning series | Documentation:Part 6 openDocument reports |
| Configure a report in a Turnkey-oriented walkthrough | Documentation:Turnkey session 10: Report |
Report workflow
- Create an OpenDocument template: use
.odtfor text documents or.odsfor spreadsheets. - Create a report ViewModel rooted in the object whose data the report represents. Add the report data columns and the required template URL and report file name information.
- Place report tags in the template. Begin with
%meta%when you need the generated list of available tags, then replace it with the tags required by the layout. - Add an action that invokes
opendocumentreportshowfor the report ViewModel, or useopendocumentreportasblobwhen your application needs the produced file as bytes. - Run the action and verify the resulting document in the target office application.
Important template checks
- Use the file extension that matches the template type:
.odtfor text and.odsfor spreadsheets. - In an ODT template edited in Microsoft Word, keep each tag intact. Font changes and line breaks within a tag can prevent MDriven from recognizing it.
- In an ODS template, report-tag values are treated as text unless the report ViewModel uses the documented naming suffixes for numeric interpretation. See Documentation:OpenDocument before designing spreadsheet totals or percentages.
- Put
%meta%first in its element and copy generated tag text without editing it when possible; tag recognition is case-sensitive.
