Page 1 of 1

Narrative reports: Birth/Baptism

Posted: 16 Jan 2023 23:15
by Peter Collier
I have a narrative report set up with a limited set of facts, which includes an individual's birth and baptism events. I'd like the report to include the baptism event only if there is no birth event. Is there a way to do that?

Re: Narrative reports: Birth/Baptism

Posted: 17 Jan 2023 10:20
by tatewise
It might be feasible but does get complicated especially if you need to cope with a variety of Date formats.
This is a starting point:
{=TextIf(%CUR_PRIN.BIRT%,,Text(%CUR_PRIN.NAME% . " was baptised" . CombineText(" on ",%FACT.DATE%,,) . CombineText(" in ",%FACT.PLAC%,,)))}

That uses the {=TextIf( %CUR_PRIN.BIRT%, , Text(...) )} expression to only display text if there is no Birth Event.

The Text(...) function starts with %CUR_PRIN.NAME% . " was baptised" that always displays the full name.
It is not possible to use the {individual} code in this context to conditionally display He/She or the Name.

That is followed by CombineText(" on ",%FACT.DATE%,,) . CombineText(" in ",%FACT.PLAC%,,) to cater for optional Baptism Date and Baptism Place fields. Again the codes {date} and {place} are not allowed in this context.
So the prefix " on " before the Date only works for full simple dates such as 10 Jan 1900.
If the Date is partial such as Jan 1900 or just 1900 then the prefix needs to be " in ".
It is possible to test if a Day number exists and select the correct prefix but as I said it gets complicated.
Furthermore, a Date Range requires no prefix at all so that may need another test.