Handling overflow in a numeric field
We're converting an app from Paradox DOS to Delphi. On the old reports,
if a numeric field was too small, asterisks would print, notifying the
user that the number didn't fit. On the new reports, the numbers are
simply truncated on the left, causing possible confusion. What is the
best way to handle something like this? Is there a setting for overflow
fields, or, if not, is there a way to write a single generic procedure
for all the numeric fields, which would determine if the current field
is too narrow for the data, and replace the number with asterisks?
Thanks
if a numeric field was too small, asterisks would print, notifying the
user that the number didn't fit. On the new reports, the numbers are
simply truncated on the left, causing possible confusion. What is the
best way to handle something like this? Is there a setting for overflow
fields, or, if not, is there a way to write a single generic procedure
for all the numeric fields, which would determine if the current field
is too narrow for the data, and replace the number with asterisks?
Thanks
This discussion has been closed.
Comments
The following example shows how to do this. It prints a "..." when the
characters do not fit within the boundary of the control.
http://www.digital-metaphors.com/tips/TextWidthFormattingEllipses.zip
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Now is there a way to do that generically?
That is, if any field in the report overflows to use this method?
In article <3e5a7738@dm500.>, "Nard Moseley \(Digital Metaphors\)"
Creating a descendant of DBText would provide the best solution.
Another solution would be to connect all of the DBText to a single
event-handler.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
property to override? OnPrint? OnGetText?
Thanks in advance.
In article <3e5b94b5$1@dm500.>, "Nard Moseley \(Digital Metaphors\)"
descendent dbText.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com