JODREPORTS(1)
π JODREPORTS π
okay bestie, so this is jodreports from the General Commands Manual section β it's the little command-line bestie that lets you use libjodreports-java straight from your terminal to merge OpenDocument text with data. no cap. let's get into it π«Ά
β¨ NAME β¨
jodreports β use libjodreports-java directly from the command line to merge OpenDocument text with data π
πΈ SYNOPSIS πΈ
jodreports <template-document> <data-file> <output-document>
π¦ DESCRIPTION π¦
jodreports is a java program that merges OpenDocument text with data by using libjodreports-java. the way that this command line tool is especially useful? for testing templates while you're adding instructions to them. iconic behaviour honestly.
So here's the vibe: you use a .properties or .xml file to hold the <data-file> that gets merged into the template. Your <template-document> needs to be an existing OpenDocument text with simple fields. a field that will be replaced with the value of a variable passed can be specified using the standard FreeMarker expression notation β you literally just type the variable name into the document like this:
Hi ${name}!
and here name gets replaced with the value passed in at runtime. slay β¨
BUT β mixing processing instructions and normal text into the document may become confusing and clutter the layout. not the look we're going for. so JOOReports provides an alternative way of inserting fields. you can insert a visual field in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. change the field Reference to JOOScript and in the following field Content enter the variable name (e.g. "$name"). this field will typically be displayed by Writer as a grayed rectangle with the variable name, while moving the mouse over it will reveal the field reference. the way that just works π
This is a nice way of keeping processing instructions separate from the document layout and is thus the recommended approach. whatever you specify as the field Reference will be treated as a FreeMarker ${...} expression, so it could also be something more complex than a simple variable name. main character energy fr fr π
To insert more advanced instructions β e.g. for conditionally displaying a portion of text, or repeating a table row for each item in a collection β you can use FreeMarker directives.
A simple directive is assign. you can use it to define a new variable, for example:
[#assign totalPrice = unitPrice * quantity]
note bestie: we always use the alternative (square bracket) syntax for FreeMarker directives. periodt.
While it may be possible to insert this directive directly as text into the template, this does not always work (for reasons we'll see below π) and as mentioned, mixing instructions into the document is a practice we want to avoid anyway. for this reason, JOOReports lets you insert FreeMarker directives as scripts. you can insert a script in Writer from the menu Insert / Script..., then change the Script type to JOOScript and insert any FreeMarker directives in the script Text box. a script will be displayed by Writer as a small green rectangle, and you can double click on it to open it and modify it. obsessed.
So your directive will be executed at the point where the script has been inserted. this is ok for something like assign but as we'll see, will not work for something like list. π
Alternatively, you can insert a FreeMarker directive in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. change the field Reference to JOOScript and in the following field Content enter the directive (e.g. "[#assign title='Mr.']"). Sample Open Document Template π
Again this provides a nice way to insert processing instructions and keept them separate from the document layout. (yes, "keept" β that's what the page says, i'm not touching it π)
The <output-document> is also an OpenDocument text and will be created as the result of the merge. β¨
JOOReports uses FreeMarker as its template engine. iykyk.
π FILES π
/usr/share/java/jodreports.jar
π AUTHOR π
jodreports was written by Mirko Nasato <mirko@artofsolving.com> and Terry Liang <terry@polonious.com.au>. kings.
jodreports was packaged for the Debian project by Sascha Girrulat <sascha@girrulat.de>.
This manual page was written by Sascha Girrulat <sascha@girrulat.de>, for the Debian project (and may be used by others). most of the used information are reused from http://jodreports.sourceforge.net. giving credit where credit is due, always π«Ά
and that's the whole page bestie!! π from the User Manuals crew, dated January 30, 2011, JODREPORTS(1) β go forth and merge those OpenDocuments, you got this βπ§
π¦ where this page comes from
- ubuntu jammy: jodreports-cli 2.4.0-3 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms