URLs in Reports
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 )
        



URLs in Reports Expand / Collapse
Author
Message
Post #20653 Posted 1/31/2008 11:31:51 AM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 9/5/2008 10:41:07 AM
GenoPro Version: 2.0.1.4
Posts: 12, Visits: 43
I was happy to learn about the <?html?> tag that can be used in reports. But it's a little hard for me to use for URLs. By the time I type the address twice, add quotes, etc. for a url (<a href="http://GenoPro.com">GenoPro.com</a>), I am liable to have some errors. And then, in order to test it, I have to generate a report, go to a browser, and try to remember who all those people are I added URLs to.

So I added the <?url processing instruction. You can add this case to "Select Case LCase(strParams(0))" in the function StrFormatText(obj, strText) in Util.vbs.

------------------
Case "url"
  if ubound(strParams) >= 1 and lcase(strMode) = "<?text?>" then
    strTemp = strParams(1)
    if instr(strTemp, "://") = 0 then strTemp = "http://" & strTemp
    strResult = strResult & "<a target=""_top"" href=""" & strTemp & """>" & strParams(1) & "</a>" & Util.HtmlEncode(strSubParts(1))
  else
    Report.LogError Util.FormatString(Dic("ErrorTextFormat"), obj, strSubParts(0))
  end if
------------------

Now I can just type
  <?url GenoPro.com?>
in a note, instead of
  <?html?><a href="http://GenoPro.com">GenoPro.com</a><?text?>
Post #20657 Posted 1/31/2008 4:13:14 PM


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: Yesterday @ 6:30:53 PM
GenoPro Version: 2.0.1.6
Posts: 1,151, Visits: 5,401
Thanks for that contribution Bob, a good idea.

I'll add it to the next release, but also allow optional link text where the user wants something different from the URL. e.g. <?url genopro.com\great genealogy software?>. for <a href='http://genopro.com' target='....'>great genealogy software</a> I also wonder whether target should be '_blank' and not '_top'. Any thoughts?


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Post #20658 Posted 1/31/2008 4:42:28 PM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 9/5/2008 10:41:07 AM
GenoPro Version: 2.0.1.4
Posts: 12, Visits: 43
I think either a target of _blank or _top would be fine. I prefer _top, but I suspect most GenoPro users would prefer _blank.

I really like the idea of having link text for the URL. I tried it by putting a second parameter in quotes, but the parser seemed to recognize spaces inside quotes as multiple parameters. Your way looks easier to use anyway.
Post #20661 Posted 1/31/2008 9:17:40 PM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 9/5/2008 10:41:07 AM
GenoPro Version: 2.0.1.4
Posts: 12, Visits: 43
I noticed that in an html report, when I click on a link that was added as an "external hyperlink" for an individual, it opens two idential browser windows containing that web page.

I added a preventDefault after window.open in the file script.js (below the "untested" comment). I don't know much about JavaScript events, so there's a fair chance that this may have broke something else, or it's not the best solution. But now it opens only one browser window when I click on a hyperlink. (This is a builtin external hyperlink, NOT a "<?url" or "<?html?>" link.)

case '_blank':
window.open(href);
evt.preventDefault(); // by bob
break;

This happened with Firefox and IE, locally and on the web. Original script.js date is 8/29/07. GenoPro version 2.0.1.4. Does this happen to everybody or just me? (It's possible I messed up a GenoPro file.)
Post #20680 Posted 2/3/2008 6:24:46 PM


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: Yesterday @ 6:30:53 PM
GenoPro Version: 2.0.1.6
Posts: 1,151, Visits: 5,401
Thanks again for this one Bob. Following your post I checked back on the original author's site (Andrew Gregory) and noticed he had released a version 1.8 of his 'Explorer Tree' and this uses preventDefault similar to your amendment. The one used in the Narrative Report is based on 1.6. However I found that 1.8 did not take into account any Base HTML element used. The Narrative Report uses 'base' to set the default target. I also found stopPropagation was still required even though Andrew had removed it. Anyway version 2.0.1.5RC1 of the Narrative Report posted elsewhere has the fix.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
« 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 7:35 AM

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