Replacing some letters with displayformat possible?
Hello,
a customer would like to "hide" the last 3 letters of a string-DBText or
better to say to replace them by XXX. It's an account number, which can
contain letters too and he wants to hide the last 3 letter.
I've tried to get it done by using the displayformat, but wasn't able to
figure out a proper format. Is it possible in general? If yes: what would be
the proper format?
Kind regards,
Mark
a customer would like to "hide" the last 3 letters of a string-DBText or
better to say to replace them by XXX. It's an account number, which can
contain letters too and he wants to hide the last 3 letter.
I've tried to get it done by using the displayformat, but wasn't able to
figure out a proper format. Is it possible in general? If yes: what would be
the proper format?
Kind regards,
Mark
This discussion has been closed.
Comments
I do not believe this is possible using the DisplayFormat of the
control. See the ppDisplayFormat.pas file for exactly how ReportBuilder
applies the DisplayFormat info to the text of a report object.
I recommend intercepting the text of the DBText before it is printed and
altering it there. (OnPrint, Band.BeforePrint, etc.).
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Delphi help and do not see any format specifiers to replace characters.
One option is to implement custom formatting. See ppDisplayFormat.pas. You
can easily create a descendant of TppDisplayFormat and specify that your
TmyDisplayFormat be used by ReportBuilder to perform formatting. See the
initialization section of ppDisplayFormat.pas.
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
thank you both for your help.
Kind regards,
Mark