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

memos at run-time

edited October 2002 in General
Hello,
I have two problems concerning memos.

The first one is :
I have set three memos m1 , m2, and mRel at design time all on a same
band, and I set to m1 the ShiftRelativeto property of mRel.
m1 is fixed and not related to any other memo. I use this memo only to have
a basis where I place mRel on the layout. m2 is a tppdbmemo.
After loading my foo.rtm, I Would like to set at run-time the
shiftrelativeto property of mRel to m2 only if the sum Height+Top of m2
(height of m2 is therefore
the height of the Rectangle in which my text sits) is greater than
Height+Top of m1.
How can i do to have an access to this height?

Mt second problem concern a tppmemo m0, that I want to modify at run-time.
How do I insert text in m0 :
I tried m0.Text:= 'MyText', but when I wnat to add some to My text,
I tried m0.Text:= m0.Text+ 'AnotherText'.
But I obtain two lines the result gives on the layout :
"
My Text
AnotherText.
"
How can I do to get Only One Line ?
In the same way I would like to know how I can control the Number of lines
I have in the memo m0.

Thanks for your helpfull suggestions, future and past.
Xavier Droubay
(on the box of Richard Hiero)

Comments

  • edited October 2002
    Since the memos are dynamic height, you can't tell beforehand which one is
    taller until the detailband has generated. Use a region to contain the two
    top memos. Then set the bottom memo to shift relative to the region, since
    the region has to stretch to contain the two memos.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    I solved my problem by using your suggestion, so Thank You.

    But now I have a problem that is rather more complicated than the one
    before.
    I have a band B1 in which I have set Two regions R1 and R2 that have the
    same top, i.e.
    R1 is in front of R2 (but R1 and R2 can have different heights).
    Each region Ri contains a shape Spi that is stretching with Ri.

    In R1, I have five memos dbme11, dbme12, me13, me14 and dbMe5 that must sit
    in the
    Shape Sp1 :
    dbme11 is on the top.
    dbme12 is under and shiftrelatedto dbme11,
    me13 is under and shiftrelatedto dbme12, and
    me14 and dbme15 are both under and shiftrelatedto me13.

    In R2, I have eight memos me21, dbme22, me23, dbme24, me25, dbme26, me27
    and dbme28
    that must sit in the Shape Sp2 :
    me21 and dbme22 are on the top of R2
    me23 and dbme24 are under and shiftrelatedto dbme22,
    me25 and dbme26 are under and shiftrelatedto dbme24,
    me27 and dbme28 are under and shiftrelatedto dbme26,


    B1 looks a bit like this at designtime in the conception window :

    -------------------- -----------------
    | dbme11 | | me21 dbme22 |
    | dbme12 | | me23 dbme24 |
    | me13 | | me25 dbme26 |
    | me14 dbme15 | |me27 dbme28 |
    -------------------- -----------------

    All the dbmeij memos are stretchable and eventually empty.
    All the meij memos are fixed at design-time, except me13 that is stretchable
    because
    the me13.Text is a memo that is set at run-time.

    I didn't find how to replace me14 and use this memo with a fixed caption as
    a label.
    (If I use me14 as a Tpplabel (let say lb14), the shiftwithparent=True for
    lb14 will put
    my label out of the shape, and the shiftwithparent=False will not allow the
    me14 component
    to shift relatively to dynamic height of me13).

    I have a problem if dbme12 or dbme11 are (both) empty, because I want to
    have in this case a lay out with some space above me13. Is there an easy
    way to Solve this problem ?
    If I use multiple regions the shapes Sp1 and Sp2 will then have to be out of
    these regions and then both stretchable relatively to the parent band B1. I
    will thus loose the independance of height between
    Sp1 and Sp2, that is why I use only two regions.

    Moreover, I don't know how to add some text me13 so that
    the result of me13.Text:=me13.Text + 'MyNewText' doesn't add a line
    and put 'MyNewText' on a new line, but this may be not a question for a
    ReportBuilder
    NewsGroup.

    Thank you for your cooperation, and sorry if it is not well explained.
    Xavier Droubay


  • edited October 2002
    > I have a problem if dbme12 or dbme11 are (both) empty, because I want to

    The goal is to set the shift relative to only when there is one of the two
    above memo has data, otherwise, don't shift relative to. This doesn't seem
    to work very well, as it resets the report engine. I cam eup with an
    alternative which uses a condtion bottom offset on the top memo to force the
    one below it to print further down even though ShiftRelativeTo is assigned.
    This approach seems to work. If you want, you can feed datapipeline data to
    a standard memo control in stead of using a dbMemo if you need to assign an
    empty string to the memo so that it works as shown in the example.

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

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.