Date: prev next · Thread: first prev next last
2021 Archives by date, by thread · List index

Hi Michael,

Sorry, I should have given an example:
Suppose there is a daily or weekly report, which includes a database query of birthday(s) for that 
report period. If so, the birthday-relevant text or table is included, with the specific birthdays; 
otherwise, no such text or table.

So the generalization is that you have a class -- say, birthdays -- and the test is whether you 
have any instances of that class for the period (or other domain) of interest. Writer makes it easy 
to conditionally hide or reveal a section of text, but not (AFAIK) to include as a condition 
whether a field is instantiated or empty.

The example you give is extremely interesting. I would not have thought of it, if only because it 
requires coordination of Calc and Writer [which I have not thought about how to do].  But the 
biggest essential difference is one that you identify -- keeping the 'conditions' outside the 
document itself -- where my initial premise was (and I think remains) to use Writer's 
conditional-text features within the Writer document.

Your example is a great one to study (and to think about how you coordinate Calc and Writer), but I 
think that Writer alone can do this job [as WordPerfect does] if there is a way to implement the 
condition that a field is either empty or filled/instantiated.  Moreover, that approach (rather 
than keeping the conditional text outside the document) allows the use of Writer's rich 
conditional-text features.  The one feature that I'm trying to reproduce is WordPerfect's ability 
to test whether any field of merged data is empty or instantiated, and use that test to 
conditionally hide or reveal a section of text.

Thanks for your reply,

On 2021-01-01 10:39, Michael H wrote:
I'm not sure what your use case is... (there's not much in your question
about what you are trying to do) I may be in the wrong postal code
with this suggestion. I'm using mail merge, and I keep all 'conditions'
outside the document itself.

I studied the Opendocument elements and I've decided that conditional text
in LibreOffice Writer is basically a doppleganger from Opendocument 1.0
that made it into the spec, but had no functionality.

So, all text that could be "hidden" now is kept in the database that I use
for the merge (which is a registered Calc spreadsheet).  And I can build my
own if statements there in new titled columns easily.

In Calc:
Column A contains book title
Column J contains number of pages in the work.
Column Z (contains paper thickness imported from a query in the calc
Column ZA contains the SpineText with the calculation: (IF(J*Z>.25,A2,"")

While the spine text here is short, I keep the entire back cover copy (up
to 5 paragraphs) in the same database, each paragraph in a separate cell
(for convenience of editing, and to make the resulting LO Writer file more
easily deal with.) I have no conditions on that back cover text but the
same method could also apply to entire paragraphs. Each point where a style
change is required, you'll need a separate cell.

This method is limited to primary text stream, and header and footer text
on each page.  That is, I haven't been able to "merge" into adhoc text
boxes In LibreWriter, only into the primary stream and header footer text.
I have been able to shift the footer text outside the defined box to
anywhere on the page, but that limits to 1 (or 2) out of stream boxes per
page, and the text can't be rotated or shaped.

On Fri, Jan 1, 2021 at 8:56 AM John Kaufmann wrote:

WordPerfect has a very useful condition for conditional text that must be
possible in Writer, but I have not figured out how to implement: How to
hide a block or section of text (or frame/figure/table/etc) unless one or
more instances of a class (to which that text pertains) exist. Is there a
way of expressing the condition
   "If: a field {IS|IS NOT} BLANK"
that can be used in the condition to hide or expose relevant text?

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.