SourceForge Logo

 

News


About


Features


Press


Download


Docs
 - Wiki
 - Installation
 - Upgrading
 - Media
 - Readme
 - Privacy
 - Developers


Support


Edit Online


Contributing


 
  PhpGedView XML Report Template Documentation

The PGV XML Report Templates provide you with a way of creating your own custom reports. PGV will attempt to read any XML file found in the "reports" directory. A simple example report can be downloaded here: simplereport.xml

The available reports are cached in the file "reports.dat" in the index directory. To activate a new report, place the XML report template in the "reports" folder and then go to the "Choose a report to run" page under the "Reports" menu. This will reload all of the report templates and create a new "reports.dat" cache file.

The XML Schema file can be downloaded here: pgvreport.xsd

An HTML API reference about the schema can be here: XS API Doc

The PGV Reports center around a given gedcom context. One of the first things you will do in a report is set the gedcom context using the PGVRGedcom, PGVRFacts, or PGVRRepeatTag tags. For example, the PGVRGedcom tag sets up the context around the record with the XREF id given in the "id" attribute for the tag which is at a gedcom level 0. So it is as if you are inside that gedcom record and all gedcom tag references start at level 1. This allows you to get a person's name in raw gedcom format by using the PGVRGedcomValue tag and looking up the NAME using the "tag" attribute (ie. <PGVRGedcomValue tag="NAME" />). You can continue down the gedcom hierarchy by delimitting the tags with colons (:). So you can get a the birthdate from the current gedcom context by putting "BIRT:DATE" in the "tag" attribute (ie. <PGVRGedcomValue "BIRT:DATE" />)

If you want to lookup a another record referenced by their @XREF@ id, you can prepend the gedcom tag with an @. The following example will get a person's marriage date by switching the current gedcom context to the person's family as spouse (FAMS)

	<PGVRGedcom id="$pid">
		<PGVRGedcom id="@FAMS">
			<PGVRGedcomValue tag="MARR:DATE" />
		</PGVRGedcom>
	</PGVRGedcom>
	
An alternative way to get this value would be:
	<PGVRGedcom id="$pid">
		<PGVRGedcomValue tag="@FAMS:MARR:DATE" />
	</PGVRGedcom>
	

The following table describes all of the XML tags available:
Tag NameDescription
PGVReport The root node that starts a PGV report template.
AttributeDescription
accessThe PGV user access level for this report. This corresponds to the options available for privacy settings. Possible values are: PGV_PUBLIC, PGV_USER, and PGV_NONE
iconThe PGV icon to use in the menus for this reports as defined by the theme.php file.
PGVRTitle The title of this report. The title will appear in the list menu items.
PGVRDescription A textual description of this report.
PGVRInput Setup an input variable for the UI which will make the user input available as a variable later in the report.
AttributeDescription
nameThe name of the variable.
lookupTells the UI that the value for this input can be looked up from a list. Possible values are: INDI, FAM, SOUR, PLAC, and DATE.
typeTells the UI generator what type of input this is. This allows you to specify whether you want a textbox input or a checkbox or a select drop-down list.
defaultThe default value that should be filled into the field.
optionsFor an input of type "select" this allows you to set which options are available to select from in the drop-down list. The options should be entering in a comma seperated list (ie. NAME,BIRT).
PGVRStyle Setup an text style that text elements may reference to set the font style used when they are rendered. This is very similar to class stylesheets in HTML. The fonts that are available to you are the 12 fonts that come standard with Adobe Acrobat and the LucidaSans font included with the project. Note that to avoid including the font in the PDF report, the LucidaSans font will be interchanged with Arial for reports that do not contain any special characters. For reports that do contain special characters, only the LucidaSans font can be used.
AttributeDescription
nameThe name you will use to reference this style.
fontThe name of the font that should be used.
sizeThe size of the font in pt.
styleBold or Italicize the font, (not available with the LucidaSans font). Appropriate values are: B, and I
PGVRDoc This is the main tag that signals the start of the report document.
AttributeDescription
pageSizeThe size of paper for this report. Possible values are: A3, A4, A5, Letter, Legal
orientationWhether this report should print portrait or landscape (P or L)
marginThe size of the margins in pt.
PGVRvar Lookup and return the value of the given variable. The variable can be one of the many internal PGV variables, one of the user input variables, or a variable set with PGVRSetVar
AttributeDescription
varThe name of the variable to lookup
PGVRvarLetter This is the same as the PGVRvar tag, except that it only returns the first letter of the variable.
AttributeDescription
varThe name of the variable to lookup
PGVRSetVar Set an internal variable that can be used in this report. Variable can be referenced using the PGVRvar tag, or in an attribute value by prepending a $ in front of the variable name (ie. id="$pid")
AttributeDescription
nameThe name of the variable to set
valueThe value to set the variable.
PGVRif Setup a condition where the children of this node will only be processed if the value of the condition attribute evaluates to true.
AttributeDescription
conditionThe condition that must be met in order to process the children nodes.
PGVRHeader Setup a header that will be placed at the top of every page.
PGVRBody Start the main body of the document. The body will create new pages as content flows over the current page.
PGVRFooter Setup a footer that will be placed at the bottom of every page.
PGVRPageHeader Setup a header that will be printed at the top of the page whenever the body flows onto a new page. The PGVRPageHeader will be printed underneath the PGVRHeader. This is allows you to have a custom header for different people or families as information flows onto succeeding pages.
PGVRFootnote This sets up a footnote in the document. Each unique footnote is numbered and that number is printed with a link to the footnote text, which is printed whenever the PGVRFootnoteTexts tag appears.
PGVRFootnoteTexts Print all of the footnotes setup while processing the document.
PGVRCell The PGVRCell is the most basic text block that can be used in a report. It differs from the PGVRTextBox in that it can only have one style of text. Because of this you will often see PGVRTextBox used more often than PGVRCell. Text in a PGVRCell will wrap to the width of the cell.
AttributeDescription
widthThe width of this cell. Setting the width to 0 will make it the width from the current location to the right margin.
heightThe starting height of this cell. If the text wraps the height will automatically be adjusted.
alignThe text alignment of the text in this box. Options are "left", "right", "center", and "justify".
styleThe name of the PGVRStyle that should be used to render the text.
borderWhether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0.
fillThe color to fill the background of this cell.
PGVRTextBox The PGVRTextBox is very similar to PGVRCell except that it may have PGVRText children which may each have their own style.
AttributeDescription
widthThe width of this box. Setting the width to 0 will make it the width from the current location to the right margin.
heightThe starting height of this box. If the text wraps the height will automatically be adjusted.
newlineAfter this box is finished rendering, should the next section of text start immediately after the this box or should it start on a new line under this box. 0 = no new line, 1 = force new line. Default is 0.
leftPosition the left corner of this box on the page. The default is the current position.
topPosition the top corner of this box on the page. the default is the current position.
borderWhether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0.
fillThe color to fill the background of this cell.
PGVRText The PGVRText element must come inside a PGVRTextBox element and will render the text at the current document position according to the given style.
AttributeDescription
styleThe name of the PGVRStyle that should be used to render the text.
PGVRList Iterate through a list of level 0 records. The child elements contained in the PGVRList tag will be repeated for ever record in the list. The list can be filtered through the filter attributes. Any number of filters can be applied. With each iteration, the gedcom context is changes to the next record in the list.
AttributeDescription
filter1Filter the list by the given expression. Filters are given in the form GEDCOMTAG EXPR VALUE, where GEDCOMTAG may be any valid tag, for example BIRT:PLAC. EXPR must be one of the following CONTAINS, GTE, LTE, or EQUALS. CONTAINS filters are usually faster than the other filters. VALUE may be any variable or literal string.
filter2Filter the list again by the given expression
filter3Filter the list yet again by the given expression
sortbyThe Gedcom tag to sort on (ie. NAME, BIRT, or DEAT)
PGVRGedcom Set the current gedcom record context. All children tags will be referenced around the gedcom record selected using the "id" attribute"
AttributeDescription
idThe gedcom XREF id of the record to use as the context for children tags. A variable (ie $pid) or a reference tag (ie @FAMS, @SOUR) may be used for the id.
PGVRRepeatTag Iterate across all of the Gedcom tags in the given in the "tag" attribute that are found in the current Gedcom context. With each iteration the current gedcom context is changes to the next matching tag's subrecord.
AttributeDescription
tagThe gedcom subordinate tag to
PGVRFacts Iterate across all of the level +1 subrecords in the current gedcom context. This is useful for iterating through all of the facts in an individual or family record. The tags that will be iterated across can be filtered using the "ignore" attribute. It is often desirable to print the family with spouse facts along with the person facts. The "families" attribute allows you to turn this behavior on or off.
AttributeDescription
ignoreA comma seperated list of tags that should be ignored when iterating through this record.
familiesWhether or not to look up family with spouse (FAMS) events when iterating through a person context. Options are 0 = don't include events from family records, 1 = include events from family records. Default = 0.
PGVRGetPersonName Get the name of the person whose XREF id is given in the "id" attribute.
AttributeDescription
idThe Gedcom XREF id for the person to lookup. Leave this attribute empty if you want to use the name from the current gedcom record context.
truncateSome reports may need to truncate long names so that they fit better in the reports. Use this attribute to specify the maximum character width that a name be printed. This will cause the processor to abbreviate multiple given names.
PGVRGedcomValue Get the value of a Gedcom tag. You can specify descendant tags by seperating them with colons (:). For example, a person's birthdate would be "BIRT:DATE". The birth place would be "BIRT:PLAC".
AttributeDescription
tagThe Gedcom tag to get the value from.
PGVRLine Draw a line on the page.
AttributeDescription
x1The horizontal starting position.
y1The vertical starting position.
x2The horizontal ending position.
y2The vertical ending position.
PGVRImage Place an image on the page
AttributeDescription
fileCurrently the only supported value is @FILE
leftThe vertical starting position.
topThe horizontal ending position.
widthThe width to set the image.
heightThe height to set the image.
PGVRHighlightedImage Place the primary object image on the page. This would be the same image that is shown on the PGV charts.
AttributeDescription
leftThe vertical starting position.
topThe horizontal ending position.
widthThe width to set the image.
heightThe height to set the image.
PGVRNow Print the current date according to the selected language rules.
PGVRPageNum Print the current page number.
PGVRTotalPages Print the total number of pages in the resulting document.
PGVRListTotal Print the totals found in the filtered PGVRList.
br Print a new line break.




Copyright © 2009 PhpGedView Team Members
ADVERTISEMENT