Global Custom Tags
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 
GenoPro Support Forum
Home        Members    Who's On
Welcome Guest ( Login | Register )
        



Global Custom Tags Expand / Collapse
Author
Message
Post #15281 Posted 12/19/2006 11:27:28 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/4/2008 10:30:00 PM
Posts: 12, Visits: 81
I am using GenoPro 2.0.0, and I am attempting to print the contents of a global custom tag. I cannot find the object that has that tag as a property.

With individual tags, I am able to say i.X_NAMTAG to read the data, but document.X_TAGYEAR and ReportGenerator.document.X_TAGYEAR throw errors. Just saying X_TAGYEAR runs without errors, but it contains the empty string.
Post #15292 Posted 12/20/2006 4:39:25 PM


Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master This user is an important contributor to the translation of GenoPro 

Group: Administrators
Last Login: Today @ 9:31:29 AM
GenoPro Version: 2.0.1.6
Posts: 3,517, Visits: 14,852
GenoPro does not have an interface to enumerate tags (custom tags and built-in tags).  This is something we plan in the future.

The English Narrative Report uses the XML fetch the custom tags.  Ron is a very smart man.

Post #15294 Posted 12/20/2006 5:17:57 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru This user is an important contributor to the translation of GenoPro 

Group: Customers
Last Login: Yesterday @ 11:03:48 AM
GenoPro Version: 2.0.1.6
Posts: 107, Visits: 1,895
Try in table layout, from there you can export the content of your custom tags to excel...
Post #15306 Posted 12/21/2006 8:11:43 AM


Grand Master

Grand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand MasterGrand Master This user is a contributor to FamilyTrees.GenoPro.com This user is an important contributor to the GenoPro community 

Group: Customers
Last Login: Today @ 10:20:31 AM
GenoPro Version: 2.0.1.6
Posts: 1,145, Visits: 5,355
The Global Custom Tag Layout details are already added to the oCustomTagRepertory object stored in the Session data as Session("oCustomTagRepertory") by Init.htm.

To list the Global Custom Tags in a table on the Home.htm frame page, just add this line before line 181 in Init.htm
 Session("Global") = oXmlDoc.selectSingleNode("/GenoPro/Global")
and insert the following before line 75 of home.htm
<%[
' Write details of Global Custom Tags to the report
'
 Dim oCustomTagRepertory, oCustomTagDictionary, Layout, Layouts, i, j, cchBufferBegin, cchBufferStart, cchBufferNow, obj
 Dim strCustomTagData, strCustomTagDesc, strPrivate, strTag, strFmtTemplate, Args()
 strPrivate = LanguageDictionary.Peek("Private")
 cchBufferBegin = Report.BufferLength
 Set oCustomTagRepertory = Session("oCustomTagRepertory")
 Set oGlobal = Session("Global")

 Set obj = ReportGenerator.Document


 Report.WriteBr "<div class='clearleft'><ul class='xT'>"
 Report.WriteFormattedLn "    <li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
 Report.WriteFormattedLn "<a name='Additional Information'></a><h3 class='xT-i inline'>{&t}</h3><ul class='xT-h'>", Dic("HeaderAdditionalInformation")

 If oCustomTagRepertory.KeyCounter("Global") > 0 Then ' Custom tags exist for this object
  Layouts = oCustomTagRepertory.Entry("Global").Count
  Set oCustomTagDictionary = oCustomTagRepertory("Global")
 End If

 For i = 1 to Layouts - 1

  Layout = oCustomTagRepertory.Entry("Global").Object(i)
  cchBufferStart = Report.BufferLength


  ' custom tags in a table.

  Report.WriteFormattedLn "<br /><li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
  Report.WriteFormattedLn "<span class='xT-i subhead bold'>{&t}</span><ul class='xT-h'><li><table class='customtagtable'>", Layout(1)
  For j = 2 to Ubound(Layout)
   strTag = Layout(j)
   strCustomTagData = Util.IfElse(strTag <> "", oGlobal.selectSingleNode(strTag).text, "")
    If strCustomTagData <> "" Then
    strCustomTagDesc = oCustomTagDictionary.KeyValue(strTag)
    Report.WriteFormattedLn "<tr><td>{&t}</td><td>{&t}</td></tr>",strCustomTagDesc, strCustomTagData
    cchBufferStart = -1   ' indicate at least one value present in this Custom Tag Dialog Layout
   End If
  Next

  Report.WriteLn "</table></li></ul></li>"

  If cchBufferStart > 0 Then ' no Custom Tags set in this Dialog Layout Section so remove phrase or table
   Report.BufferLength = cchBufferStart
  Else
   cchBufferBegin = -1 ' indicate at least one custom tag set
  End If
 Next
 Report.WriteLn "</ul></li></ul></div>"
 If cchBufferBegin > 0 Then ' no Custom tags present so remove the Additional Information section
  Report.BufferLength = cchBufferBegin
 End If
]%>

This code is largely taken from the WriteAdditionalInformation subroutine in Util.htm.

Alternatively with the above change to Init.htm you can of course access individual Global custom tags using
Set oGlobal = Session("Global")
and then use oGlobal.selectSingleNode("tagname").text for each required tag.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Post #15317 Posted 12/21/2006 4:00:53 PM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/4/2008 10:30:00 PM
Posts: 12, Visits: 81
That works, Ron, thanks. Maybe this should be added to the documentation.
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: GenoProSupport, JcMorin, Ron

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 12:49 PM

Copyright 1998-2008 GenoPro. All rights reserved. GenoPro and the GenoPro logo are trademarks.