Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Hyperlinks on TppDbText

edited May 2010 in General
RbPro 11.08 / Delphi 2006

Are hyperlinks supposed to work with TppDbText?.

We have existing layouts with TppDbTexts for web- and email addresses. They
where not treated as hyperlinks. But we did got complaints from some of our
users that those fields suddenly were printed as hyperlinks.
It turns out that you can change the hyperlink setting in the layout-editor
in a unexpected way.
Just open and save a layout in the designer. If "Show data" is on then all
DbTexts that had a valid hyperlink when displayed in the designer will be
treated as hyperlinks. This is because the hyperlink property of those
DbTexts is now fiilled and saved with the template. To add to the confusion,
the link is clickable in the designer preview but not in the print-preview.

Also in the designer, when you drag and drop a datafield with a hyperlink in
it, the created DbText will have the hyperlink property filled, but the
HyperLinkColor is changed to clWindowText. So it is printed underlined and
black. We hide the object inspector for the end users so they have no
possibility to change the hyperlink settings. (We consider the object
inspector to dangerous for the end-user and the property names and values
cannot be translated). So we added a simple dialog to edit the hyperlink
settings for TppLabels en TppDbTexts.
Our users can now use TppLabels to make clickable hyperlinks. But TppDbTexts
are not working OK, but at least they can disable the hyperlinks.

It seems to me that TppDBTexts are missing the call to ProcessHyperlink, for
TppLabels this is done in SetCaption. Also the clickable state is determined
at pagestart. As a result TppDbTexts are never clickable in the
print-preview and if the HyperLink property is filled they always print as
hyperlink, even if the data is not a valid hyperlink. And if they were
clickable they would always navigate to the url in the hyperlink property
not to the one in the datafield.

This leads to some questions:
- Are those issues resolved in RbPro 12.
- Why are hyperlinks always printed as such, its nice to have clickable
links in the preview and pdf's but clickable links on paper? That's the
complaint of our users, their email address on invoices where printed
underlined. Perhaps an extra property to disable printing of hyperlinks?
- How are TppDbTexts hyperlinks handled in pdf's generated by RbPro. We are
still using RbExportDevices from Pragnaan but considering upgrading to RbPro
12 and use its new export devices.


Regards,

Max Paay
Quadrant Software bv.
The Netherlands.

Comments

  • edited May 2010

    I researched this and fixed two issues, which will be included in the next
    RB 12 build.

    1. When an .rtm is saved, the font was sometimes saved incorrectly - it had
    the hyperlink color and style applied.
    2. The drag-and-drop feature did not process the hyperlink correctly.
    (ProcessHyperLink was called, but then after that, a font changed was
    applied and in this state, the hyperlink color was set to black).

    The DBText.GetTheText method retrieves the caption text from the
    datapipeline and calls ProcessHyperlink. In my testing and tracing in the
    debugger, this is firing correctly.

    The RB PDF output includes support for the hyperlinks - it works the same as
    the RB print preview, the links are hot clickable.

    When DBText.HyperLinkEnabled is set to False, no hyperlink logic is
    processed/displayed.

    There is not a HyperLinkPrintEnabled property. That is something we can
    consider adding to a future release.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2010
    Hi Nard,

    Thanks for your reply. Sorry for my remark about not calling
    ProcessHyperLink. My err, have to check my own sources first!. In our
    derived version of TppDbText.GetTheText that call was missing. Added it and
    it works perfectly now.
    Leaves only the two minor designer issues. Any change for a patch for 11.08,
    or just a hint how to solve them?

    Thanks again,

    Max Paay
    Quadrant Software bv.
    The Netherlands.
  • edited May 2010
    I was not able to create a patch for RB 12, because the fix requires
    modifying the interface section of the unit.

    Sorry, but we do not have the resources to maintain the old code base. If we
    maintain RB 11, then customers will want fixes for RB 10, RB 9, etc. If I
    help you maintain your old code base, then all customers demand the same.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.