i have been trying to work out how to generate multiple documents from spreadsheet rows. I have a template laid out with multiple fields, and I want to fill those fields from a calc spreadsheet; I have spent a lot of time looking at the documentation and at other guides and haven’t found any that seems to answer this.
The work flow I am trying to sort out is
.ott + .ods → multiple .odt → multiple pdfs.
.ott + .ods → multiple pdfs.
I don’t think this is a particularly uncommon use case but I have found basically no docs or guides on how to achieve this.
if it helps I am using
Version: 22.214.171.124 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 6.0; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.utf8); UI: en-GB
Presently I haven’t installed the Base component but I think you should look at it. It provides a report generator, taking input from a “database” (which can be as simple as a spreadsheet) to generate various reports: Writer docs, PDFs, plain text, … I don’t remember if you can base the Writer docs on a template but you can always force a template on the resulting document with the Template Changer extension.
This is valid if you used word “template” with the technical Writer meaning, i.e. a “dictionary” of styles. If “template” means some fixed user layout, this is done by the report generator.
Read up on “database reports” and “serial letters” (aka “form letters”, aka “mail merge”).
How to connect a spreadsheet document to a Base document so (parts of) the spreadsheets appear as database tables:
Specify the document
Register database = Yes
Save the database.
Now you can generate mail merge fields by dragging column headers from the data source window (Ctrl+Shift+F4) into Writer. And you can generate database reports.