Does LibreOffice Writer support repeating section content control?

Hi, everybody.

I’ve created a template in MS Word with CustomXML and table with repeating section content control to show data from CustomXML.

Now I’m trying to automatically generate docx documents with different data in CustomXML and found that Writer does not dynamically build table to fill it with data from CustomXML.

Table always contains fixed number of rows, which was created in template.

This leads to the fact that not all data from CustomXML is displayed in the generated document.

When I open the same generated document in MS Word, it’s displayed correctly.

What’s wrong?

Does LibreOffice Writer not support repeating control section, or did I make mistake?

Thanks!

Since many of us (most?) don’t use M$ Word, please explain CustomXML features? Is this an integrated part of Word or an add-on? What is a “repeated control section”?

Take note that what Word calls a section is not the same as a Writer section, unless you use word “section” as a generic term for designating any part of a document.

Generally speaking, using an application to edit a foreign format (DOCX is not a LO native format) and generate a document in this foreign format is not a good idea. You will never get the expected result, especially if you want to use advanced capabilities which are likely to be unique or proprietary. Compatibility is limitesd to widely agreed upon primitives.

Thank you for quick response!

CustomXML feature is part of Office Open XML (OOXML) and allows to store data to show in document.
“Content control” is a placeholder text in which the current content will be replaced. (here LibreOffice help page about this)

Content control can be bonded to corresponding part on CustomXML and this data will be used to replace current content.

Here is good example of this.

“Repeating section content control” is content control which allows to create repeating set of other content controls. It can be used for example, to fill table in document with data.

I’ve tried LibreOffice Writer with different combinations of content controls and CustomXML and all worked fine except for repeating section content control. :frowning:

The page you reference clearly indicates form context. In Writer, forms won’t satisfy your purpose because they are intended to receive user input.

In “standard” text processing mode, you also have special fields of type Placeholder but they are also meant for manual replacement.

The closest procedure I can see is mail merge but is not as sophisticated as what you’re looking for and definitely can’t generate a full document Filling in tables is also very difficult, perhaps impossible.

That’s the thing, it supports more than just user input :slight_smile:

You can try to make sure of that.

  1. Extract template (docx is just zip-archive):
    xmldemo.docx (20.6 KB)
  2. Change file customXml/item1.xml
  3. Compress as zip (don’t forget save result archive with extension docx)
  4. Open in LibreOffice Writer.

You’ll see that document content will be changed without any user input.

To return to my question: it doesn’t seems to Writer support repeating section content control :frowning:

After looking at various parts in your .docx, I think Writer is unable to handle CustomXML. As I already mentioned, the nearest feature is probably Mail Merge but it can’t easily fill-in tables.


Depending on the expected output, a full-LO solution would be to use the Report Generator which comes with the Base DB front-end. The “database” can be a Calc spreadsheet or even a CSV plain-text file.

But this means you won’t use any of your existing documents.

1 Like