Bug in Writer? Hidden Sections act strangely

Hi,

I have six sections in a Writer document with different conditions to hide them ( [Database.Table.Var1] NEQ x with x= 1 - 6).
When I fill each section with some variables from Database.Table and then populate those fields (View → Data Sources → Data to Fields) with specific rows of the Database, the five sections that meet the condition to be hidden are not always actually hidden.

The trigger for the bug appears to be the number of pages. If the whole document fits on one page, the sections act normally (i.e. disappear when meeting the hiding criterion) once I populate fields from the database. Once the document is a two (or more?) page document, the sections which should be hidden are not hidden anymore.

Edit: Yes it’s the number of pages.

  • If the fields have not been populated and thus all six sections are correctly displayed on one single page, populating the fields with database rows makes sections correctly disappear if they meet the hiding criterion.

  • If the fields have not been populated and thus all six sections are correctly displayed on two pages, populating the fields with database rows makes the sections that meet the hiding criterion stay. If the text then fits onto one page (for example my field names are longer than the entries in the database I populate them with), populating the fields with another row makes the sections meeting the hiding criterion disappear.

  • If the fields have not been populated and thus all six sections are correctly displayed on two pages, populating the fields with database rows makes the sections that meet the hiding criterion stay. If the text then still takes up two pages, populating the fields with another row makes the sections meeting the hiding criterion stay.

I experimented with a pure Writer document (no connection to a database) as such:

  • 2 groups of paragraphs extending on two pages
  • the first group has attribute Hidden so that the resulting doc should only need one page
  • a bookmark in the visible group (in page 2 when everything is visible)
  • a final paragraph containing a reference to the bookmark for its page number and page count insertion

When I request Print Preview, I get a single page with “See page 1. Total 1 (page)”.

However, what I see on screen in “normal” mode seems highly dependent on view options.

I run routinely LO Writer with View>Formatting Marks enabled. In this mode, hidden paragraphs (see below) are displayed and the text occupy 2 pages with the final paragraph saying “See page 2. Total 2” which seems to be the same as what you have.

If I disable View>Formatting Mars or Tools>Options>LibreOffice Writer>Formatting Aids, Hidden text, screen display is a single page with last paragraph as “See page 1. Total 1”.

What you experience may be an artefact due to viewing options.

The solution may depend on your purpose: whether you want the DB query result directly on screen (Writer is then your DB browser) or you want to produce documents for customer or other people. In the latter case, I suggest to use Base’s report generator to create and export Writer documents (I did it that way to create invoices).

Thanks for your effort!
I don’t have Formatting Marks enabled though. I’ll be doing more research and report back.