🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Microsoft office and OpenDocument as a Report generator
This page was created by Wikiadmin on 2023-12-20. Last edited by Wikiadmin on 2026-07-29.

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

  1. Create an OpenDocument template: use .odt for text documents or .ods for spreadsheets.
  2. 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.
  3. 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.
  4. Add an action that invokes opendocumentreportshow for the report ViewModel, or use opendocumentreportasblob when your application needs the produced file as bytes.
  5. 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: .odt for text and .ods for 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.

See also