Page 1 of 1

Add Relationship to Root on Web Family Group sheet (for Web, CD or DVD)

Posted: 31 May 2022 21:19
by BakerJL75
In a custom version of the Web Family Group sheet (for Web, CD or DVD) Report, I would like to change the Heading/Family Member line to also show the relationship to root. It's currently %INDI.NAME[1]%. Assuming Mary Doe is the root person I'd like it to be John Doe - father of Mary Doe. I know how to do this, but I need a data reference equivalent to =Relationship(FileRoot(),,TEXT,1). Or is there a way to use a function as a data reference if that makes sense.
query.jpg
query.jpg (307.58 KiB) Viewed 759 times

Re: Add Relationship to Root on Web Family Group sheet (for Web, CD or DVD)

Posted: 01 Jun 2022 07:57
by rodit
Hello there

I have used the following Edit to the Family Member Data Reference to achieve what you are looking for:

Change %INDI.NAME%
%INDI.NAME:ADORNED_FULL% (=LifeDates2()) is =Relationship(FileRoot(),%INDI%) of =FileRoot()

Cheers
Roger

Re: Add Relationship to Root on Web Family Group sheet (for Web, CD or DVD)

Posted: 01 Jun 2022 09:26
by tatewise
Jackie, the thing you overlooked is that the Heading Text box allows Expressions and not just Data References.
Most such boxes wherever Data References are allowed also allow Functions.
The main exception is the customisation of fields in the Property Boxes, which only support a subset of Data References.

The expression proposed by Roger works well except in two cases:
  1. If the Family Member is the Root person then it says:
    Mary Doe (1900-1970) is root of Mary Doe
  2. If the Family Member is unrelated to the Root person then it says:
    Jack Smith (1900-1970) is of Mary Doe
So the relationship part needs to be conditional by using the =TextIf(...) function and testing for the values "root" and "":
%INDI.NAME:ADORNED_FULL% (=LifeDates2())=TextIf( Relationship(FileRoot())="root" or Relationship(FileRoot())="" , "" , Text( " is " . Relationship(FileRoot()) . " of " . FileRoot() ) )

Re: Add Relationship to Root on Web Family Group sheet (for Web, CD or DVD)

Posted: 01 Jun 2022 11:59
by davidf
Thanks, that is a useful expression when customised for diagrams:

=TextIf((Relationship(%CUR_DGM_ROOT%,,TEXT,1) = "root") or (Relationship(%CUR_DGM_ROOT%,,TEXT,1) = ""),"",Text(%CUR_DGM_ROOT% . "'s " . Relationship(%CUR_DGM_ROOT%,,TEXT,1)))

Swapping the possessive around to avoid:
"wife's brother's wife of Joe Doe" in favour of
"Joe Doe's wife's brother's wife"
Which somehow reads more comfortably!

(May start a thread about propagating such a change through all my diagrams and text schemes across multiple projects!)

Re: Add Relationship to Root on Web Family Group sheet (for Web, CD or DVD)

Posted: 01 Jun 2022 14:49
by BakerJL75
Thanks everyone. I totally missed that I could use a function there.