Changes

Jump to: navigation, search

Fi:Gramps 5.0 Wiki-käyttöohje - Raportit Osa 2

16,620 bytes added, 19:42, 27 December 2018
Partial translation
{{man index|Fi:Gramps_5.0_Wiki-käyttöohje_-_Raportit_Osa_1|Fi:Gramps_5.0_Wiki-käyttöohje_-_Raportit_Osa_3|5.0}}
{{languages|Gramps_5.0_Wiki_Manual_-_Reports - part 2}}
{{#vardefine:chapter|11.2}}
{{#vardefine:figure|0}}
Takaisin [[Gramps_5.0_Wiki_Manual_-_Reports|Index of Reports]].
<hr>
This section describes the substitution values that can be used in the different reports available in Gramps.
= Substitution Values =

Many of the [[Gramps_5.0_Wiki_Manual_-_Reports_-_part_4#Graphical_Reports|graphical reports]] allow you to customize the information that is displayed on the reports. Variable substitution is the method that is used to substitute a particular symbol (key) for specific information about the person in the database.

For example:
{| {{prettytable}}
|-
! colspan="2"|Substitution Keys
! colspan="2"|Will show as: (the person is alive)
|-
!Line 1
|<code>$n</code>
!Line 1
|Smith, Edwin Michael
|-
!Line 2
|<code>b. $b{ at $B}</code>
!Line 2
|b. 1961-05-24 at San Jose, Santa Clara Co., CA
|-
!Line 3
|<code>d. $d< at >$D</code>
!Line 3
|d.
|-
|}

In the next section a list of all available variables (The Substitution Keys) follows.
* If you wish to display names, date, or place information differently, you may use [[#Format Strings|Format Strings]] to accomplish this.
* There are also [[#Control Variables|Control Variables]] to display special characters (like the dollar sign).
* You can also use [[#Grouping|Grouping]] to optionally display information. In the example above '''Line 2''', uses grouping to display <code>' at '</code> only when the birth place is known.
* Along with [[#Events|Events]] you can print almost anything.
* Finally, [[#Separators|Separators]], to make your life complete. In the example above '''Line 3''', uses this to display <code>' at '</code> only when both the birth date and place is known.

== The Substitution Keys ==
{| {{prettytable}}
|-
! colspan="2"|Personal variables
! colspan="2"|Marital variables
|-
!$n
|Displays the person's name
!$s
|Displays the name of the person's spouse
|-
!$i
|Displays the Gramps ID for the person.
!$j
|Displays the Gramps ID for the marriage.
|-
!$b
|Displays the person's date of birth
!$m
|Displays the marriage date of the person and the spouse.
|-
!$B
|Displays the person's place of birth
!$M
|Displays the place of the marriage of the person and the spouse.
|-
!$d
|Displays the person's date of death
!$v
|Displays the divorce date of the person and the spouse.
|-
!$D
|Displays the person's place of death
!$V
|Displays the place of the divorce of the person and the spouse.
|-
!$a
|Displays an attribute about the person.
see [[#Attributes|Attributes]] for more
!$u
|Displays an attribute about the marriage.
see [[#Attributes|Attributes]] for more
|-
!$e
|Displays event information about the person.
See [[#Events|Events]] for more
!$t
|Displays an event information about the marriage.
See [[#Events|Events]] for more
|}

All of the Marital variables are defined by the person's preferred spouse in Gramps. If the person has never been married, then these variables will not display anything.

==== Other Substitution Keys ====
* <code>$T</code> Displays Todays date.

=== Default displayed formats ===
{| {{prettytable}}
|-
!$n $s
|Names will be displayed as set in 'Name format:' on the Display tab in Gramps preferences
|-
!$B $D $M $V
|Places will display the Place title by default
|-
!$b $d $m $v $T
|Dates will be displayed as set in 'Date format:' on the Display tab in Gramps preferences
|-
!$e $t
|Events will display the description by default
|}

=== Deprecated variables ===

Some of the old variables were deprecated because [[#Format Strings|Format Strings]] have replaced them. So here is a list of those variables and how to achieve their results:

{| {{prettytable}}
|-
!Old Variable
!How to display it now
!What is displayed
|-
|$f
|$n
|Name - as by Gramps name display under Preferences
|-
|$n
|$n(g f)
|Name - FirstName LastName
|-
|$N
|$n(f, g)
|Name - LastName, FirstName (note the explicit comma)
|-
|$nC
|$n(g F)
|Name - FirstName LastName in UPPER case
|-
|$NC
|$n(F, g)
|Name - LastName in UPPER case, FirstName
|-
|$by
|$b(yyyy)
|Date of birth, year only
|-
|$dy
|$d(yyyy)
|Date of death, year only
|-
|$my
|$m(yyyy)
|Date of preferred marriage, year only
|-
|$p
|$s
|Preferred spouse's name as by Gramps name display under Preferences
|-
|$s
|$s(g f)
|Preferred spouse's name - FirstName LastName
|-
|$S
|$s(f, g)
|Preferred spouse's name - LastName, FirstName
|-
|$sC
|$s(g F)
|Preferred spouse's name - FirstName LastName in UPPER case
|-
|$SC
|$s(F, g)
|Preferred spouse's name - LastName in UPPER case, FirstName
|}

== Format Strings ==

Format strings are used to display names and dates differently than those assigned under Gramps Preferences. Here is the syntax for a format string:

$''{{man label|key}}''(format string)<br />
where: ''{{man label|key}}'' is one of the following characters: 'nsijbmBMdvDVauet'

A format string is any text, separators or format codes (defined below) to display information about the person.

=== Formatting names ===

For names <code>($n $s)</code> you may use the following formatting codes to display the name differently.

{| {{prettytable}}
|-
!t
|Title
!f
|Given name
|-
!x
|Common name. Call name if existing, otherwise first first name
!c
|Call name
|-
!n
|Nick name
!s
|Suffix
|-
!l
|Surname
!g
|Family nickname
|}

These codes can be upper-cased to uppercase the result.

For example:
{| {{prettytable}}
|-
!Formatting code
!Displays
|-
|<pre>$n(L, f) ($n(c)), $n(L, f){ ($n(c))}
$s(f l s)</pre>
|<pre>SMITH, Edwin Michael (), SMITH, Edwin Michael
Janice Ann Adams</pre>
|}
{{man note|Note:|If you want to print a character 'c' within the format string (or any one of the other format codes), you will need to first add a <code>'&#92;'</code> in front of it. See [[#Control Variables|Control Variables]] for more.}}

{{man note|Note:|The curly brackets <code>{ }</code> are used to hide information. Here it is used around <code>' ($n(c))'</code> to not display <code>' ()'</code> if the person does not have a call name. See [[#Grouping|Grouping]] for more.}}

=== Formatting Dates ===
For all of the date variables <code>($b $d $m $v)</code> you may use the following formatting codes:

{| {{prettytable}}
|-
!yyyy
|The year as a four digit number
!yyy
|The year, with a minimum of three digits
|-
!yy
|The year, from 00 to 99
!y
|The year, from 0 to 99
|-
!mmmm<BR>
'''MMMM'''
|The full name of the month<BR>
The full name IN CAPS
!mmm<BR>
'''MMM'''
|The abbreviated name of the month<BR>
The abbreviated name IN CAPS
|-
!mm
|The month, from 00 to 12
!m
|The month, from 0 to 12
|-
!dd
|The day, from 00 to 31
!d
|The day, from 0 to 31
|-
!o
|The date type (modifier)
!
|
|}

For example:
{| {{prettytable}}
|-
!Formatting code
!displays
|-
|<pre>$b(mmm-dd yy)
$m(yyyy/mmm/d)
$b(mmm-dd yy)</pre>
|<pre>May-24 61
1995/May/27
Jun-04 85</pre>
|}

{{man warn| For date types (modifier) |Only "Before", "After", and "About" are supported at this time. all others will not display anything.<BR>And for date span and date ranges, only the starting (first) date is displayed.}}

=== Formatting Places ===
For all of the place variables <code>($B $D $M $V)</code> you may use the following formatting codes:

{| {{prettytable}}
|-
!e
|Street
|
!l
|Locality
|-
!c
|City
|
!u
|County
|-
!s
|State
|
!p
|Postal Code
|-
!n
|Country
|
!t
|Title
|-
!x
|Longitude
|
!y
|Latitude
|}
These codes can be upper-cased to uppercase the result.

For example:
{| {{prettytable}}
|-
!Formatting code
!displays
|-
|<pre>$B
$B(c, s, N)</pre>
|<pre>St Judes Hospital
Carmel, IN, USA</pre>
|}

=== Rules for format strings ===

* Anything will print inside a format string
* You need to use [[#Control Variables|Control Variables]] to display things like <code>')'</code> and format codes
* Separators can be within format strings.
* At least ONE format code has to display something for the ENTIRE format string to display

For examples:
{| {{prettytable}}
|-
!Formatting code
!displays
|-
|<pre>$n(f l)
b. $b {at $B
{d. $d $D</pre>
|<pre>Edwin Michael Smith
b. 1961-05-24 at San Jose, Santa Clara Co., CA</pre>{{man label|The person is still alive (or has no information present) so the line was removed.}}
|}

== Control Variables ==

Control variables allow you to print characters that are special to Substitution values within a display.

For example the dollar character '$' is used to note the start of a variable. If you wish to print a dollar character you would use a control character like '&#92;$'

{| {{prettytable}}
!Control Variables
!Result
|-
!&#92;$
|Displays a single <code>'$'</code>
|-
!&#92;&#92;
|Displays a single <code>'&#92;'</code>
|-
!&#92;(
|Displays a single <code>'('</code>
|-
!&#92;)
|Displays a single <code>')'</code>
|-
!&#92;{
|Displays a single <code>'{'</code>
|-
!&#92;}
|Displays a single <code>'}'</code>
|-
!&#92;<
|Displays a single <code>'<'</code>
|-
!&#92;>
|Displays a single <code>'>'</code>
|}

Basically anything that comes after a <code>'&#92;'</code> will be printed.

{{man note|Note:|When you are inside a format string, you may need to use this to display a character that would normally be a format code.}}

For example:
{| {{prettytable}}
|-
!Formatting code:
!displays
|-
|<pre>$b(m hi mom)
$b(m hi \mo\m)</pre>
|<pre>5 hi 5o5
5 hi mom</pre>{{man label|As this person was born on the fifth month.}}
|}

== Grouping ==

There are instances where you do not want certain text to be displayed.

Take the example:
{| {{prettytable}}
|-
!Formatting Code
!Only date is known
!Only place is known
|-
|<code>died on $d at $D</code>
|<code>died on 1975-06-26 at</code>
|<code>died on at Reno, Washoe Co., NV<code>
|-
|}
Neither of these displayed results are very acceptable.

But with groups (denoted by '''&#123;&#125;'''), you can optionally print information if a variable within contains information.

{| {{prettytable}}
|-
!Formatting Code
!Only date is known
!Only place is known
|-
|<code>died{ on $d}{ at $D}</code>
|<code>died on 1975-06-26</code>
|<code>died at Reno, Washoe Co., NV</code>
|}
Which is a more preferable displayed result than in the first example.

=== Rules for groups ===

A group will only display if there is at least one variable that displays something. So if a group only has text and/or variables where the information is not known, the entire group will not print.

Groups can also be nested. If this happens (like below), the outer group will only display if there is at least one variable that displays something within the outer group or any of the sub groups.

Groups can also be used to remove text. If you wish to not display the entire line, <code>'-'</code> at the start of a line will remove the entire line from the display if the above rule is true.

If you do not wish to have the display code above (for death information) displayed (the person is alive, or you do not yet know the information), modify the code to look like:
* <code>-{died{ on $d}{ at $D}</code>

=== Examples ===
This will hide <code>'('</code> and <code>')'</code> if the divorce information is not known (or still married).
* <code>m. $m $M {- ($v(yyyy))</code>

Only display some spouse information if married or remove the entire line if never married:
* <code>{$s $m(yyyy) {- $v(\(yyyy\))}}</code>

== Attributes ==
Attributes do not have a format string. Instead the attribute name is placed inside <code>[]</code>. Here is the syntax for an attribute:

$''{{man label|key}}''[attribute name]<br />
where: ''{{man label|key}}'' is one of the following characters: 'au'

For example:
{| {{prettytable}}
!Formatting code
!displays
|-
|<pre>$a[Profession]
$a[Social Security Number]
$a[Total \$ bequeathed]</pre>
|<pre>Programmer
7A3-29-F1C6
3.00USD</pre>
|}

== Events ==

Events have the same starting structure as attributes, <code>$e</code> or <code>$t</code> and the event name in <code>[]</code> but events have an extra format string after the name to display the description, date, place, id, and attributes associated with it. Each of these items can be displayed with a , a 'n', 'd', 'D', 'i', and 'a' respectively in the format string. Here is the syntax for an event:

$''{{man label|key}}''[attribute name](format string)<br />
where: ''{{man label|key}}'' is one of the following characters: 'et'

=== Event format strings ===

The Event format string is used to display information about the event. Here are the format codes to display parts of the event:

{| {{prettytable}}
!Formatting code
!displays
!
!Formatting code
!displays
|-
!n
|Description
|
!i
|Event ID
|-
!d
|Event Date&#42;
|
!D
|Event Place&#42;
|-
!a
|An attributes for the event&#42;&#42;
|
|
|
|}

&#42;These variables can themselves have format strings. Date and a place can be formatted with format string as defined in [[#Format strings|Format strings]].

&#42;&#42;Attribute needs to have the attribute name in [] and are formatted as above.

For example:
{| {{prettytable}}
!Formatting code
!displays
|-
|<pre>$e[First Communion](d(yyyy-mm-d))
$e[Bar Mitzvah](n&lt; at &gt; D)
$e[Birth](d(yyyy mm/dd) D)</pre>
|<pre>2009-11-6
Jerry's Bar Mitzah at Opas house
2007 05/23 Grandmothers house</pre>
|}

And:
{| {{prettytable}}
!Formatting code
!
!displays
|-
|<pre>$b(yyyy-Mmm-dd)
$M</pre>
|is the same as
|<pre>$e[Birth](d(yyyy-Mmm-dd))
$t[Marriage](D)</pre>
|}

=== Notes for attributes and events ===

Attribute and event names are mandatory. <code>'$a'</code> or <code>'$a[]'</code> will not display anything.

Attributes and event names may have special characters within them. Most notably <code>']'</code> and <code>')'</code>. If this is the case, you will need to use [[#Control Variables|Control Variables]]

== Separators ==

Separators are special 'text only' groups inside <code>'&lt;'</code> and <code>'&gt;'</code> that conditionally display a separator (like <code>', '</code> or <code>' - '</code>) between two groups, variables, format codes or text.

Separators are displayed conditionally depending on these rules:
* A variable that does '''not''' display anything will remove itself and a separator that is to the left of it from the display line only.
* If there is not a separator to the left, the same variable will remove itself and a separator that is to the right of it from the displayed line.
* If there are two separators together, the left one will be removed from the display line and the right is kept.
* Separators at the start or end of the display line (or format strings) are removed.

Take this example formatting code:
* <code>$s(f l s)&lt;, &gt;$m(yyyy)&lt; @ &gt;$M&lt; - &gt;$v(&#92;(yyyy&#92;))</code>

Here are some things that may happen:
{| {{prettytable}}
!Possibility
!Outcome
|-
|If '''none''' of the variables are known
|None of the separators will display
|-
|If only one variable '''is''' known
|Only that variable will print. No separators will print.
|-
|If only the spouse's name '''is not''' known
|The first separator will not display
|-
|If only the marriage date '''is not''' known
|The first separator does not display. We will be left with:
Jane Doe&lt; - &gt;{ … }And only the divorce date needs to be known to print the second separator.
|-
|If only the divorce date '''is not''' known
|the second separator will not display
|}

Separators can be inside format strings:
* <code>$n(&lt;0&gt;T&lt; &gt;L&lt;, &gt;f&lt; &gt;s)</code>

Unlike groups, separators can not cross over/out of format strings. So the separator <code>&lt;0&gt;</code> will NEVER display. No matter what is on the left hand side of the variable.

Here is a useful example:
* <code>{({b. $b}<, >{d. $d})}</code>

This will:
{| {{prettytable}}
|-
|Only print the outside () if either the birth or death date displays<br>
Only displays the center separator if both dates are known.<br>
So here are some thing that could display
{|
|-
|<code>(b. 1970-4-8)</code>
|<code>(d. 2012-3-9)</code>
|<code>(b. 1970-4-8, d. 2012-3-9)</code>
|or the line does not print at all.
|}
|-
| We will not see things like:
{|
|-
|<code>()</code>
|<code>(, )</code>
|<code>(b.)</code>
|<code>(b., )</code>
|<code>(d.)</code>
|-
|<code>(, d.)</code>
|<code>(b. 1970-4-8, )</code>
|<code>(b. 1970-4-8, d.)</code>
|<code>(, d. 2012-3-9)</code>
|<code>(b., d. 2012-3-9)</code>
|}
|}

{{-}}
<hr>
Back to [[Gramps_5.0_Wiki_Manual_-_Reports|Index of Reports]].
{{man index|Fi:Gramps_5.0_Wiki-käyttöohje_-_Raportit_Osa_1|Fi:Gramps_5.0_Wiki-käyttöohje_-_Raportit_Osa_3|5.0}}
{{languages}}
{{grampsmanualcopyright}}

[[Category:Documentation]]
[[Category:Plugins]]
872
edits

Navigation menu