Home Subreports

TppMemo Question

edited July 2005 in Subreports
I have a Tppmemo that can contain various amounts of text but the memo
can not stretch, i.e. the memo has to fit within a specific amount of
space on the page. Since it can not stretch there are times when some
characters / lines are lost when the memo prints. When there is to
much to print I'd like to reduce the font but I cant figure out how to
determine when there is to much to print.

Is there anyway to determine how many characters a memo will actually
print?

Thanks

Craig

Comments

  • edited July 2005
    Hi Craig,

    Take a look at the following example of shrinking the font size so a memo
    will fit on one page regardless the size. This should get you on the right
    track.

    http://www.digital-metaphors.com/tips/ForceFontToOnePageReport.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Nick,

    My question is not how to reduce the font but rather when . i.e.
    how do you tell if the memo contains more lines/characters then it can
    print? Since the memo cant stretch it wont force a new page but
    rather it just prints what it can within the space allotted and
    ignores the remaining text. I need to know when its going to do this
    so I can then reduce the font.

    Craig

    On Mon, 25 Jul 2005 07:37:31 -0600, "Nico Cizik \(Digital Metaphors\)"
  • edited July 2005
    Hi Craig,

    Ah ok.... I can think of two ways to approach this.

    1. Knowing the width and height of the memo object, you should be able to
    calculate how many lines of text at a certain font the memo will hold. Once
    you find this number, you can compare it to the memo text being entered into
    the memo object in the detailband.beforeprint event and change the font size
    if necessary.

    2. Set up a two pass report and during the first pass, check the
    TppMemo.Lines.Count property to find out how many lines are going to be
    contained in the memo. Knowing the size of the memo before hand should let
    you know how many lines will fit before hand.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Thanks,

    I think I'm going to go with a mod of option 1 -- crude approximation
    based on the number of characters in a line. Should work --

    Craig

    On Mon, 25 Jul 2005 10:35:59 -0600, "Nico Cizik \(Digital Metaphors\)"
This discussion has been closed.