* Customizing Reports

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
avatar
jsnyder
Silver
Posts: 7
Joined: 18 Dec 2014 23:35
Family Historian: V6

Customizing Reports

Post by jsnyder » 03 Apr 2015 15:31

I'm new to posting inquiries in FHUG, so I hope I'm clear on what I am trying to do. I've been using FH V6 for a few months and have been pleased with the flexibility of customizing diagrams, reports, queries, etc. However, I am generally puzzled by the proper use of expressions and functions. I've studied the Knowledge Base and Help topics on Expressions of Contexts of Use, Understanding Data References and Functions, Text Templates, Report Options Dialog, etc. I haven't begun to look into Lua and writing plugins, but I don't think what I'm trying to do requires something that complex.

I've been able to customize some reports by adding simple expressions in Text, Format, and other tabs in diagrams and some reports. However, I am stuck on how to customize parts of the Contents tab of Report Options in the Individual Summary Report. I'm able to show a list of children in the Main Section by selecting "show if not empty" under the children Label and I can add new Items like =ChildCount(). But I have two questions:

1. Can I add Record Id to each of the children? With common names showing up regularly in a project involving a couple thousand individuals, it's helpful to have their Record Id appear next to each name. The Item Details under the children Label is grayed out and cannot be modified (if that is even the proper place to add the expression).

2. Can I add custom lists to the Main (or other) Section? Even replicating the list of children by adding an Item, Label, and Expression would be a good start. The expression %INDI.~CHIL[1]>% adds one child's name and changing the index number results in a different child's name but the results show only one name. I suspect adding an expression that deals with a loop is somehow needed but I've experimented with using "1+" and that doesn't work.

Thanks in advance for any help on this particular issue. The answers are probably right in front of me but I can't seem to find them. Other than the Knowledge Base and Help references I mentioned earlier any additional tutorials or examples of how to use expressions would also be appreciated.

Joel

User avatar
tatewise
Megastar
Posts: 16847
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Customizing Reports

Post by tatewise » 03 Apr 2015 18:45

Joel, that is an impressive start.
Plugins will not solve your current problem with Reports.
I guess you have seen the following KB articles:
Knowledge Base > Understanding Data References
Knowledge Base > Understanding Functions
Knowledge Base > Using Flags and Icons and Expressions shows Expressions (Data Refs & Functions) applied in a different context.

You can Add to Main Section Items but cannot Edit/Delete standard items, other than Hide or Show.
So to create your Children list, first Hide the standard Children item.

Now Add an item:
Label: Child 1
Expression: %INDI.~CHIL[1]>% [=RecordId(%INDI.~CHIL[1]>%)] (=LifeDates2(%INDI.~CHIL[1]>%))
Show if not empty

Now repeat for Child 2, Child 3, et seq with index [2], [3], et seq in each Expression until you have catered for largest family.
Unfortunately, the looping index [1+] only works in Diagram Text Schemes.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
jsnyder
Silver
Posts: 7
Joined: 18 Dec 2014 23:35
Family Historian: V6

Re: Customizing Reports

Post by jsnyder » 04 Apr 2015 14:38

Mike,

Thanks for your very prompt reply. Your suggestion worked just fine. I hadn't considered adding multiple expressions. I know that FH is ever evolving and has many ways to customize reports. Perhaps editable standard items, loops, and the like will be features considered in the future. I'm also glad to know that plugins won't address this particular issue.

Thanks again for your help.
Joel

User avatar
tatewise
Megastar
Posts: 16847
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Customizing Reports

Post by tatewise » 04 Apr 2015 15:07

Editing Standard components is a risky business.
Standard Queries cannot be edited.
Standard Items in Reports cannot be edited.
I would argue, and have suggested to Calico Pie, that no Standard components should be edited.
Just as with Queries they should be cloned and then the clone customised.
I strongly recommend you adopt this tactic.
Then if your custom component does not behave itself, you have the Standard to try to see if it is an inherent 'feature' or your customisation at fault.

Some Standard Report Items cannot be edited, because they don't use a supported Expression.
Children is an example, because there is no looping Expression available to users to display all Children.

I have also suggested to Calico Pie that the [1+] looping index should be supported in other contexts than Diagram Text Schemes, but don't hold your breath!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
jsnyder
Silver
Posts: 7
Joined: 18 Dec 2014 23:35
Family Historian: V6

Re: Customizing Reports

Post by jsnyder » 06 Apr 2015 17:35

Mike,

I agree that clones are clearly the safest way to go for manipulating any standard components and features and is a practice I've followed from the beginning. I like your suggestion to Callico Pie about adding looping capabilities.

By the way, I followed the procedure to completion of adding multiple expressions and indexing them to accommodate the largest family. It works functionally, but practically it's less than desirable. The resulting report shows "Child __: [] (-)" for every blank "Child", which means that there are 12 lines of "Child __: [] (-)" for individuals with no children. I erroneously thought that the "Show if not empty" would take care of this situation. Maybe I've missed something. It looks like I'll be retreating to the standard format for listing children and forgo the Record Id.

Thanks again.
Joel

User avatar
tatewise
Megastar
Posts: 16847
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Customizing Reports

Post by tatewise » 06 Apr 2015 19:23

It can still be done with a little more Expression.
I overlooked the complication of the three components (Name, RecId & Dates) that always produce some text.

So the Expression becomes:
=ExistsText( %INDI.~CHIL[1]>%, Text( %INDI.~CHIL[1]>% . " [" . RecordId(%INDI.~CHIL[1]>%) . "] (" . LifeDates2(%INDI.~CHIL[1]>%) . ")" ) )

The outer most ExistsText function is:
=ExistsText( %INDI.~CHIL[1]>%, Text( "A" . "B" ) )
This tests the child Data Ref and if it exists the text AB is produced.

The Text function encapsulates all the component parts into one string:
Text( %INDI.~CHIL[1]>% . " [" . RecordId(%INDI.~CHIL[1]>%) . "] (" . LifeDates2(%INDI.~CHIL[1]>%) . ")" )
Each component part is separated by an intervening dot.

Note how nested functions never have a leading = sign.

Simply replace all four [1] with appropriate child index in each Child Expression.

When a child does not exist then no text is produced so is automatically hidden.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
jsnyder
Silver
Posts: 7
Joined: 18 Dec 2014 23:35
Family Historian: V6

Re: Customizing Reports

Post by jsnyder » 08 Apr 2015 15:14

Mike,

Again, thanks for working through this to find a solution. You are a master at understanding all the nuances of FH. It's taken me awhile to digest the expression/functions you've explained, but your suggestions work quite well. As I work with these changes and study the results, I am now using this custom report for various families, some of which involve more than one marriage. The report now avoids the multiple blank lines of "...[] (-)". However, I see that it lists all children of all spouses together. It may be more than FH can handle but is there a way to group children by spouse? The standard Individual Summary Report does this, but there doesn't seem to be a way to add Record Ids the children (or anyone else). Currently the only way to do this is by way of the Index, which shows everyone in a single list and it appears separately at the end of the report.

Back to the original goal, which was to show Record Ids whenever possible to help sort out the issue of common names appearing multiple times in projects involving a couple thousand individuals. Your insight into why this feature doesn't exist or why it isn't possible may trump this suggestion, but it would seem a great benefit to everyone if Callico Pie could add a checkbox or toggle for showing Record Ids in virtually every report. (It exists in some but not all reports now.) In my limited work with FH so far, diagrams seem to be a little more customizable, so that feature wouldn't seem to be necessary there.

Thanks,
Joel

User avatar
tatewise
Megastar
Posts: 16847
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Customizing Reports

Post by tatewise » 08 Apr 2015 15:59

Yes, it is possible to list the Children of each Marriage separately.

The current Expressions use the Data Ref to list all Children in sequence:
%INDI.~CHIL[1]>%
This can be obtained form the <<Insert Data Ref button of the Data Ref Assistant (DRA).
Simply select the Child shortcut at the bottom of the list.

To get Data Ref for Children per Spouse use <<Insert Data Ref button.
Expand Family as Spouse>> and select Child>> to get:
%INDI.FAMS[1]>CHIL[1]>%
Where FAMS[1] is 1st Marriage, FAMS[2] is 2nd, et seq, and CHIL[1] is 1st Child of that Marriage, etc.

The labels become Marriage (m) Child n where m & n match the FAMS and CHIL indices.

Interestingly, some Reports do have an Option to include Record Id globally, includng Narrative Reports, Outline Reports, and Multimedia Report. So in principle it can be done in any Report.

The Record Id can usually be added to the Individual named in the header by adding =RecordId() to the Heading Text on the Format tab of the Report Options.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
jsnyder
Silver
Posts: 7
Joined: 18 Dec 2014 23:35
Family Historian: V6

Re: Customizing Reports

Post by jsnyder » 09 Apr 2015 14:04

Thanks. It's taking awhile to understand how to use the DRA and what all the expressions do. It's beginning to sink in. Your suggestion does what I was hoping it would.

Thanks again for all your help.

Post Reply