How to get a Memo to 'Stretch' correctly?

hsmhsm
edited 7:38AM in FastReport 4.0
I have a memo and a sub report in one master band.
In a previous topic { How to make group headers work?, (with the text vertical!) from May 17 2012 } the user 'gpi' suggested that I should set the stretch property of the master band to true and the stretchmode property of the memo to SmMaxHeight. The example report they posted works OK.

I am sure I have done exactly what gpi suggested but in my report the memo still displays at the design height, not the height of the sub report.
Below are screen shots of the properties of the master band, the memo I want to stretch and what the report looks like.
In the report the green memo is the one that should be stretched and the blue line shows qwhere the memos should be streched to.

Can anyone see where I am going wrong?

Master band

Comments

  • gordkgordk St.Catherines On. Canada.
    edited September 2015
    HI HOWARD
    it appears to me that the top of the memo is set to 0, i think this might be outside of the master band top
    forget the above,
    try removing the sub report temporarily to see if you can get the memo to stretch also what is wordwrap set to
  • hsmhsm
    edited 7:38AM
    gordk wrote: »
    HI HOWARD
    it appears to me that the top of the memo is set to 0, i think this might be outside of the master band top
    forget the above,
    try removing the sub report temporarily to see if you can get the memo to stretch also what is wordwrap set to
    Wordwrap on the memo is true but it only contains two words at most.

    Removing the subreport didn't print anything, not even the memo. But I didn't expect that to work as the memo has nothing to stretch against. ie if there is nothing on its right hand side to make the data band get taller, why should it stretch at all.

    Yes memo.top = 0 but that is 0 with respect to the data band so that should be OK

    The words in the memo are at 90 degrees if that's any help.

    Also this is quite a nested report

    Master data 1 (fed by a data set with one record per student) contains just a subreport called SubreportOneFaculty (but will show other stuff later)
    SubReportOneFaculty (fed with data about that one student in one particular faculty) contains the memo in question, showing the faculty, and a subreport called SubreportSubjectData
    Subreport SubreportSubjectData (fed with data about the subjects taken by that student within that faculty) contains a series of memos all on one line containg data about that subject.

    My screen shot of the report just showed the first left hand memo from SubreportSubjectData as the rest just contain numbers. Its SubReportOneFaculty thats not working as it won'tstretch the faculty name alongside the subreport showing all subjects within that faculty.

    Hope thay helps
  • hsmhsm
    edited September 2015
    Solution - nearly
    In the end, through trial and error I have come up with the solution but it introduces another problem if the band with the memo and subreport on are themselves in a subreport from a higher level.
    If there is a master band containing a memo next to a subreport and you want the memo stretched vertically to occupy the same height as the results of the subreport then the properties must be set as folows.

    For the memo
    Memo1.DataField := nil;
    Memo1.DataSet := nil;

    and in the memo place the data that you want to show eg [frxDBDataset1."MyField"]

    For the subreport
    Subreport1.PrintOnParent := true; //<-- this appears to be the crucial line

    Setting Subreport1.PrintOnParent := true; appears to be the important line.
    Without it all the lines of the sub report appear correctly and the memo correctly appears once per set of sub report lines but the memo doesn't stretch.
    With Subreport1.PrintOnParent set to true set the memo does stretch to fit the size of the sub report results

    Note:
    HOWEVER this causes the subreport to overtprint the previous time it displayed data causing the data to be unreadable. See below where a subreport shows the faculty plus the results of another subreport showing subject group and Mastery Average. There are 8 subject groups within 4 faculies but the Mastery Average for PE and Art have been overwritten

  • gordkgordk St.Catherines On. Canada.
    edited 7:38AM
    Hi howard happy to see you worked it out?
    interesting that when the memo contains just an expression it stretches but not when connected to a datafield.
    in that master band was the subreport created(added) before the memo?

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.