GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
Ancestor Report how to show the age ?


https://support.genopro.com/Topic39557.aspx
Print Topic | Close Window

By Regislab - Thursday, March 21, 2019
I would like to add the age in this report but I am not able to code it in xml due to my uncompetency in programing.
Could someone help me to do it or to explain how to get this done ?
Many thanks for any help.
Gérard
By genome - Saturday, March 23, 2019
You can age in brackets at the end of each individual's details by changing 2 lines in the Ancestors.htm template file at line 109.  I have highlighted the additions required.

i.e. 

Report.WriteFormattedBr "<b>{0}.</b> {9}{1&t}<span style='font-size: xx-small;'>{8}</span> {2}{3&t} {4&t}{5}{6&t} {7&t}{10}", (iKey+1), oName,_
strBorn, oName.Birth.Date, oName.Birth.Place,_
strDead, oName.Death.Date, oName.Death.Place,_
Util.IfElse(iKey > 0,  oName.Session("lineage"), ""), oName.Session("union"), _
Util.IfElse(oName.Age <> "", " (" & oName.Age.NYears & ")", "")


I have attached a copy of the modified file.  This is for GenoPro 2018 but I do not think it has changed from GenoPro 2011.
By Regislab - Sunday, March 24, 2019
Oh great, many thanks, absolutely what I wanted w00t
By the way, if I will say : 50 years in the report, is it correct if to just add the word "years", next to the number of years ?
Gérard
By genome - Sunday, March 24, 2019
Even easier, just use oName.Age instead of oName.Age.NYears I think then if age is less than a year it will show months Smile
By Regislab - Sunday, March 24, 2019
Yes, many thanks, it works, I have tried it Smile
But I thought to have it written on the language used for the report, for example, when I use the french one, it still be written years, months and so on, in English and not années, mois, etc in French. Whistling
So I think it is better, if the age is just indicated like 70 years or 70 ans or 70 Jahren, and not all the details in month and day too.
By genome - Sunday, March 24, 2019
Add this to the French Dictionary.xml just above the <DateFormatting> line

<FmtTimeSpan>
<!-- 
            Duration Formatting Options:
                {}        Output the value in numeric format (1, 2, 3, ...)
                {N}        Output the value in narrative cardinal (one, two, three, ...)            
             -->
<FmtDay>
{N} jour
</FmtDay>
<FmtDays>
{N} jours
</FmtDays>
<FmtMD> <!--  nine months and one day  -->
{0} et {1}
</FmtMD>
<FmtMonth>
{N} mois
</FmtMonth>
<FmtMonths>
{N} mois
</FmtMonths>
<FmtYear>
{N} année
</FmtYear>
<FmtYears>
{N} années
</FmtYears>
<FmtYM> <!--  one year and four months  -->
{0} et {1}
</FmtYM>
<FmtYMD> <!--  two years, six months and twelve days  -->
{0}, {1} et {2}
</FmtYMD>
</FmtTimeSpan>


I will leave it to you to translate the comments Hehe


By Regislab - Sunday, March 24, 2019
Many thanks again :-)
I have tried it but it did not work, I habe probably done a mistake, but do not see which one.
Here, attached, the dictionary.xml of the skin from the concerned french report, where I have just copy/paste the code you give, above the line <DateFormatting>
By genome - Sunday, March 24, 2019
Sorry  <DateFormatting> is wrong. I meant to say </DateFormatting> Blush
By Regislab - Sunday, March 24, 2019
Blush
Many thanks, I have tried also above </DateFormatting> but same result ... Crying
By genome - Sunday, March 24, 2019
The attached Dictionary.xml works for me with French Ancestors Report
By Regislab - Sunday, March 24, 2019
Confirmed, many thanks Smile
I have checked everything again, and I have found my mistake (use oName.Age instead of oName.Age.NYears).
It was also a misunderstanding, as I had supposed to see, when written for example : 71 years, 10 months and 10 days, to see only 71 years, and not the month and days.
I presume this is not possible to do.
By genome - Sunday, March 24, 2019
To show only years, change

<FmtYM> <!--  one year and four months  -->
{0} et {1}
</FmtYM>
<FmtYMD> <!--  two years, six months and twelve days  -->
{0}, {1} et {2}
</FmtYMD>



to this

<FmtYM> <!--  just years  -->
{0}
</FmtYM>
<FmtYMD> <!--  just years  -->
{0}
</FmtYMD>
By Regislab - Sunday, March 24, 2019
Wow great, many thanks, absolutely what I have wished w00t
By Regislab - Sunday, March 24, 2019
By the way, as I tried the last version of the code you just gave me, I have seen a little error, I can't not resolve. It seems not linked to the modification we have done recently together, but it is linked to the report.
I have attached the printscreen of the report log and both files, dictionnary.xml and ancestors,htm may be concerned.
By genome - Monday, March 25, 2019
Your phrase for the tag FmtAncestorsGeneQty is wrong.

It should be 

<FmtAncestorsGeneQty T="This report comprises {0} generations, including the base Individual."/>
By Regislab - Monday, March 25, 2019
Many thanks, I have corrected it and everything is working well now Wink