Memo shifting

edited 4:55PM in FastReport 4.0
Hello again ! [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> This time I encountered the following problem. Let's assume that I have three memos on the child band. Then I change (at runtime) the visibility of the second one to false. I would like Memo3 to be automatically shifted up ([/img] screen)

I managed to configure memos in the way that they are shifted down depending on text height (ShiftMode and StretchMode property).
Changing 'top' property of Memo3 is not a propert solution for me as in general I have much more complex reports and I would really like to avoid calculating it.

I prepared sample program which shows my problem. It can be downloaded here: http://www7.zippyshare.com/v/37182983/file.html

Thank you very much in advance!

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:55PM
    set each successive memo in its own child band chain childbands one to the other
    and set printifinvisible prop to true
  • edited March 2009
    gordk wrote: »
    set each successive memo in its own child band chain childbands one to the other
    and set printifinvisible prop to true

    Unfortunately this solution in my case is even worse than calculating 'top' property [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I also considered it. My reports will consist of bands - each one with its own set of memo components logically related. Adding child band to a child band would have solved the problem but as far as I know this is not possible.[/img]
  • gordkgordk St.Catherines On. Canada.
    edited 4:55PM
    works fine for me.
    child1 memo1 child1 child prop set to child2
    child2 memo2 child2 child prop set to child3 printchildifinvisible set true
    child3 mem03 child3 child prop set to child4
    note you control band visibility not the memo
    or use the engine object to control where printed outputof object starts
    you will need to remember and set engine.cury accordingly
    also you can't put a child in a child but you can place a subrep in a child
  • edited 4:55PM
    Thanks for You answer.
    gordk wrote: »
    works fine for me.
    child1 memo1 child1 child prop set to child2
    child2 memo2 child2 child prop set to child3 printchildifinvisible set true
    child3 mem03 child3 child prop set to child4
    note you control band visibility not the memo
    For me as well but unfortunately I can't use this soultion because of some other external restriction of my project (not FastReport). Other solution are also OK but still not suitable for me.

    Anyway, I decided to write a machanism to shift memos on my own. And as You can easily imagine I've got a problem [img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> Let's say I have the following situation:[/img]
    -------------
    | Memo1   |
    -------------
    Blank space
    -------------
    | Memo2   |
    -------------
    

    Memo1 has the following properites: Top: 10; Height: 30
    Memo2: Top: 80; Height: 30

    Then I add some multiline text to the first memo. If the text exceedes height I can get the new one by using CalcHeight function. And that's fine. But I couldn't retrive in any way correct Top property of Memo2. I know that FastReport does calculate it (of course only when ShiftMode and StretchMode properities are being set properly), because whenever I show the preview memos are shown correctly.

    In general my memo list to shift will be much more complex but the idea is the same - how to get the correct 'Top' property? Calculating it on my own is like writting the second algorithm >
  • gordkgordk St.Catherines On. Canada.
    edited 4:55PM
    the problem is that you are trying to shift design heights.
    what you really want to do is alter the engines output to the finished page
    by setting the engines cury value
    see the usersmanual chapter on script "using the engine object".
    Note that objects within a band are handled in the order in which they were created.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.