Could someone tell me what is wrong with the syntax in the following. $spid has the same format as the ID = ' ' but the engine insists that I put a > in. The two variables print out exactly the same but the ' if ' just won't work. I have tried it in every possible position but it still asks for it.
The problem is that the <PGVRGetPersonName id=’ ‘ /> and <PGVRGetPersonName id='$spid' /> aren't functions that return text. Instead, the names they produce are inserted directly into the output stream currently under construction.
Also, the stuff inside the double-quotes (the condition) becomes part of a regular PHP "if" statement that's executed after the insertion of the condition has taken place. There's no provision in the class_reportbase.php script to allow for XML to be nested within other XML statements.
Exactly what are you trying to accomplish here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Canajun2eh.
Thank you for that explanation which does answer my problem very clearly.
I am trying to doctor the descendency report into an ancestry report which will show each family's children. I have it working fine using "ancestors" in the PGVRRelatives group = This will produce an ancestry report with all the children in, but of course it shows them twice, once for each partner of a marriage. I therefore take the 'spid' variable from the marriage bit where the @HUSB@ or @WIFE@ is identified and will only let the report show the children after the second partner of a marriage is displayed. I want to put the if condition in front of <PGVRRepeatTag tag="FAMS"> .What I can't do is to find how to do it. I have tried turning the <PGVRGetPersonName id=’ ‘ /> into a user variable, but that doesn't work. I have tried to use the ID and SPID directly, but can't get that to work either.
That's it really. Any suggestions gratefully received.
John H
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<!- this section gets the children.->
<PGVRRepeatTag tag="FAMS">
<PGVRSetVar name="individual" value="$cpid" />
<PGVRSetVar name="spouse" value="$spid" />
<PGVRGedcom id="@FAMS">
<PGVRif condition="@CHIL!=''">
<PGVRSetVar name="numberOfChildren" value="0" />
<PGVRRepeatTag tag="CHIL">
<PGVRGedcom id="@CHIL">
<PGVRSetVar name="numberOfChildren" value="$numberOfChildren+1" />
</PGVRGedcom>
</PGVRRepeatTag>
<PGVRif condition="$individual == $spouse"> This line ensures that it is printed only below the spouse and not below both partners.
etc etc.
It works on the desktop PGVGedView. I have a couple of page formatting bugs on the web site but am working on that tomorrow.
I do hope you don't mind me playing with your descendency report. My problem was not knowing the syntax and not knowing where to find it either. We're getting there.
Regards
John H
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could someone tell me what is wrong with the syntax in the following. $spid has the same format as the ID = ' ' but the engine insists that I put a > in. The two variables print out exactly the same but the ' if ' just won't work. I have tried it in every possible position but it still asks for it.
<PGVRif condition="<PGVRGetPersonName id=’ ‘ /> == <PGVRGetPersonName id='$spid' />" >
blah blah blah
</PGVRif>
Many thanks in advance
John H
The problem is that the <PGVRGetPersonName id=’ ‘ /> and <PGVRGetPersonName id='$spid' /> aren't functions that return text. Instead, the names they produce are inserted directly into the output stream currently under construction.
Also, the stuff inside the double-quotes (the condition) becomes part of a regular PHP "if" statement that's executed after the insertion of the condition has taken place. There's no provision in the class_reportbase.php script to allow for XML to be nested within other XML statements.
Exactly what are you trying to accomplish here?
Hi Canajun2eh.
Thank you for that explanation which does answer my problem very clearly.
I am trying to doctor the descendency report into an ancestry report which will show each family's children. I have it working fine using "ancestors" in the PGVRRelatives group = This will produce an ancestry report with all the children in, but of course it shows them twice, once for each partner of a marriage. I therefore take the 'spid' variable from the marriage bit where the @HUSB@ or @WIFE@ is identified and will only let the report show the children after the second partner of a marriage is displayed. I want to put the if condition in front of <PGVRRepeatTag tag="FAMS"> .What I can't do is to find how to do it. I have tried turning the <PGVRGetPersonName id=’ ‘ /> into a user variable, but that doesn't work. I have tried to use the ID and SPID directly, but can't get that to work either.
That's it really. Any suggestions gratefully received.
John H
Hi Canajun2eh.
I sussed it in the end. Code below.
<PGVRRelatives id="$pid" group="direct-ancestors"
<!- this section gets the children.->
<PGVRRepeatTag tag="FAMS">
<PGVRSetVar name="individual" value="$cpid" />
<PGVRSetVar name="spouse" value="$spid" />
<PGVRGedcom id="@FAMS">
<PGVRif condition="@CHIL!=''">
<PGVRSetVar name="numberOfChildren" value="0" />
<PGVRRepeatTag tag="CHIL">
<PGVRGedcom id="@CHIL">
<PGVRSetVar name="numberOfChildren" value="$numberOfChildren+1" />
</PGVRGedcom>
</PGVRRepeatTag>
<PGVRif condition="$individual == $spouse"> This line ensures that it is printed only below the spouse and not below both partners.
etc etc.
It works on the desktop PGVGedView. I have a couple of page formatting bugs on the web site but am working on that tomorrow.
I do hope you don't mind me playing with your descendency report. My problem was not knowing the syntax and not knowing where to find it either. We're getting there.
Regards
John H