* Printing relationship in reports

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Printing relationship in reports

Post by blazegate »

Would it be possible to add an option to print the relationship to the root when generating reports?
User avatar
Jane
Site Admin
Posts: 8507
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Printing relationnship in reports

Post by Jane »

Which report do you want to include the information on. For some reports it's easy and on other's it's a bit more involved.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationnship in reports

Post by tatewise »

Probably yes, but which types of Report, and for which Individuals?
e.g.
For Publish > Individual Summary Report the heading line at top of report can include relationship.
Use Report > Options > Format tab then under Heading select Record and click Edit.
In the Heading Text after (=LifeDates2()) insert =Relationship(FileRoot()) at the end.
Click OK twice.
The header will then be as below, but the Father: and Mother: entries underneath have no relationship, but they could.
Example Individual Summary Report with Relationship in Header
Example Individual Summary Report with Relationship in Header
ISRrelationship.png (57.71 KiB) Viewed 9762 times
The more specific detail you can put in your question, the more useful will be our answer.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
BobWard
Superstar
Posts: 420
Joined: 18 Nov 2012 01:50
Family Historian: V6.2
Location: Mesa, Arizona, USA

Re: Printing relationnship in reports

Post by BobWard »

Here is another optional layout to show the relationship to the root person using the ISR format.
Attachments
Relationship to Root in ISR Rpt.JPG
Relationship to Root in ISR Rpt.JPG (227.45 KiB) Viewed 9706 times
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationnship in reports

Post by blazegate »

Bob,
Many thanks for your quick reply.
I am really looking to get the relationship printed in a narrative report. For example, with myself as the root, I would like to be able to print a narrative report of my ancestors printing all their relationships to me.

Kind regards,
Brian Bucklar
avatar
BobWard
Superstar
Posts: 420
Joined: 18 Nov 2012 01:50
Family Historian: V6.2
Location: Mesa, Arizona, USA

Re: Printing relationnship in reports

Post by BobWard »

Brian,

I only use the ISR format for my reports, so I can't offer any tips on getting your relationship request to appear in the Narrative report format. However, I am sure that Mike, or others, will be along shortly to help you with that.
Bob
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationnship in reports

Post by tatewise »

As Jane said, "For some reports it's easy and for other's it's a bit more involved."

Narrative Reports are quite a bit more involved.
They rely entirely on Sentence text derived from Facts entered against each Individual.
So to get relationships into the Report needs a Relationship fact against each Individual.

Such a fact does not already exist as a standard fact so you need to use Tools > Fact Types to create a new custom fact.
Use the New button to create a fact named say Relationship.
Its Sentence Template could be {individual} was the {=Relationship(FileRoot(),%CUR_PRIN%,TEXT,1)} of {=FileRoot()} so it says something like He was the grandfather of Brian Bucklar.
If you want that to appear in the Report before the birth details, then set Normal Time Frame to Pre-Birth.
To appear immediately after the birth details, then set the Normal Time Frame to Shortly After Birth.

Add that Relationship fact to every Individual wherever you want that sentence to appear in the Report.
You would NOT include it in the File Root Individual as it would say He was the root of Brian Bucklar.

But what if you want to cater for various different File Root settings from time to time?
Then you must literally add the Relationship fact to everyone, and change the Sentence Template to be conditional.
{=TextIf( IsSameItem(FileRoot(),%CUR_PRIN%), "", Text( Sex(%CUR_PRIN%,"He","She","He") . " was the ". Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) . " of " . FileRoot()))}
So this tests if File Root and current person are the same, and if so then output the empty string "", otherwise the original sentence but with {individual} replaced by Sex(%CUR_PRIN%,"He","She","He").

In NON-Narrative Reports you may wish to exclude that Relationship fact, but that is up to you.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationnship in reports

Post by tatewise »

I have given the Narrative Report case a little more thought.
There are cases that are not handled by my proposed Sentence Template expression.
  1. In addition to excluding the root person's relationship to themself, it also needs to exclude the root person's children whose relationship of son or daughter is already stated in the narrative.
  2. When there is no relationship at all then the whole sentence must be inhibited.
  3. For some relationships such as father's wife or mother's husband the sentence does not read well.
In addition to all that, I have realised that the Birth event Sentence Template can accommodate the relationship phrase without any need for a custom Relationship fact.
So forget about creating a Relationship fact and just Edit the Birth event Sentence Template to the following expression:

{individual} was born< {date}>< {place}>< ({age})>{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}

which says something like: He was born on 1 May 1900 in London and is Brian Bucklar's grandfather.
unless the relationship is unspecified and so nothing is produced.

The CombineText(...) function only produces any text if a relationship is specified.
If the File Root is the current person or their father or mother then the relationship is blank "" and unspecified.
If the Relationship(...) function returns nothing then the relationship is also unspecified.

That seems to work well in all Narrative Reports (both Ancestor and Descendant) regardless of who is the File Root and who is the Report Root person, providing each person has a Birth event.

To cater for those without a Birth event, but with a Baptism event, then Edit the Baptism event Sentence Template to use the following expression, which adds the condition to exclude text if a Birth event exists:

{individual} was baptised< {date}>< {place}>< {age}>{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%) or Exists(%CUR_PRIN.BIRT%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}.< The godparents were {role(plural)=godparent}.>< The godparent was {role(single)=godparent}.>< The ceremony was conducted by {role=minister}.>< The ceremony was conducted by {role=priest}.>
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationnship in reports

Post by blazegate »

Many thanks for your comprehensive reply,
I think it will take me a while to get to grips with the contents but I will try my best.
Brian
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationnship in reports

Post by blazegate »

Sorry to be a nuisance but could you please explain how to access the Birth Event Sentence Template so I can edit it.
Kind regards,
Brian Bucklar
User avatar
LornaCraig
Megastar
Posts: 3190
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Printing relationnship in reports

Post by LornaCraig »

To edit the sentence template for any fact, use Tools > Fact Types then select the fact in the list and click the Edit button to the right. See how_to:narrative_report_fact_sentence_templates|> Narrative Report Fact Sentence Templates for full details.
Lorna
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationnship in reports

Post by blazegate »

Many thanks to all for your help to date.
Unfortunately, editing the birth statement as suggested results in printing rather than executing the code following <(place)> eg:

Tony Roy Bucklar son of Brian George Bucklar and Sheila Ellen Titmus was born on 27 November 1965 in Chippenham, Wiltshire, England{=CombineText( Text(" and is " .FileRoot()."s"), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%).

I have copied and pasted your revised Birth Sentence Template to avoid any typing errors.

Kind regards,
Brian
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationnship in reports

Post by tatewise »

Unfortunately, you have not copy pasted the full function, which is:

Code: Select all

{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}
Your posting shows only the first fragment of that text and is missing several closing ) and } brackets that are essential for correct syntax. They must be in matched pairs, and all the other components must be exactly correct. These software expressions are very fussy, and if not perfect then will simply appear in the resulting sentence.

If you cannot fix it, please post the text from the Sentence Template of your Birth Event definition.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationnship in reports

Post by blazegate »

My birth sentence is: {individual} was born< {date}>< {place}>< ({age})>{=CombineText( Text( " and is " . FileRoot() . "'s "), TextIf(IsSameItem(FileRoot(),%CUR_PRIN%) which is a copy/paste from your instructions.

I am aware of the need to match the quantity of brackets but note that the above statement after ({age}) has one opening { with no matching } and six ( with only four )

Kind regards,
Brian Bucklar
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationnship in reports

Post by tatewise »

Brian, can you see that your Sentence Template is much much shorter than mine in the CODE box earlier.

Yours stops short at ...%CUR_PRIN%) whereas mine shown earlier continues:
...%CUR_PRIN%) or IsSameItem(FileRoot(),%CUR_PRIN.~FATH>%) or IsSameItem(FileRoot(),%CUR_PRIN.~MOTH>%), "", Relationship(FileRoot(),%CUR_PRIN%,TEXT,1) ) )}

Please click SELECT ALL then Copy the blue highlighted text and Paste it into your Sentence Template to replace the {=CombineText(...%CUR_PRIN%) text.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
blazegate
Gold
Posts: 11
Joined: 15 Mar 2009 23:54
Family Historian: V6.2
Location: Gedney, Spalding, Lincolnshire

Re: Printing relationship in reports

Post by blazegate »

Eureka!!
Having copied and pasted the full expression, everything works perfectly.
My sincere apologies for not doing this in the first place, (it would have saved you a lot of agro) .
When I first read your instructions, where you had "or" I thought these were alternatives to replace the "IsSameItem etc " in the first line of the code. At 85, I have probably lost too many brain cells.
I have been using FH since version 2.3 and it continues to impress.

Again, many thanks for the excellent program and for your excellent support.
Brian
User avatar
tatewise
Megastar
Posts: 28333
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Printing relationship in reports

Post by tatewise »

I'm glad the result is to your liking.
Yes, the or are combining three alternative cases for the Principal, the Father, and the Mother, each of which must exclude the relationship as it is already in the core sentence.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply