Creating RichViews on the fly positioning problem

edited 10:42AM in FastReport 4.0
Hello,


I need to create RichViews on the fly
The number of the RichEdits is unknown so I create them in a While cycle
The size and the length of the RichEdit data might vary: and this causes the problem.

The RichEdits are set: Align=baWidth,Height=0,02 (because I don't know in advance the height),StrechMode=smMaxHeight,ShiftMode= smAlways

The problem is this: normally when I make the second RichView the top would be: the top of the first RichView + the height of the first RichView.
But the Height of the first is ALWAYS 0,02 no matter that in reality it is much bigger (because of the strechmode).

How can I get the REAL height of the richview? (the streched height)?

Thank you

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 10:42AM
    you don't need to find out out put height.
    you must create your richview's design properly,
    create a child band with a richview for each one, set stretch props and allow split and stretch mode for memoview.
    and of course set the child prop of the previous band to new band.
    Since you are working with design page, make sure that you have set the large height in design mode prop to true.
  • edited 10:42AM
    gordk wrote: »
    you don't need to find out out put height.
    you must create your richview's design properly,
    create a child band with a richview for each one, set stretch props and allow split and stretch mode for memoview.
    and of course set the child prop of the previous band to new band.
    Since you are working with design page, make sure that you have set the large height in design mode prop to true.

    Hello,

    Thank you for your help.
    My problem is that I don't use data bands because there is no dataset. And if there is no dataset, the Richviews on the child bands won't be shown.

    What I use after creating the Richviews on the fly is:

    RichView.RichEdit.Lines.LoadFromFile('_a.rtf'); // here I load a bunch of rtf files one by one

    So now the Richviews are on the ReportSummary.
    This is one of my problems with Fr: I can't make a "normal" band that is *not* connected to a dataset. (in Rave there was a possibility for that).


  • gordkgordk St.Catherines On. Canada.
    edited 10:42AM
    you can create a databand with no dataset just set rowcount prop to 1
  • edited 10:42AM
    gordk wrote: »
    you can create a databand with no dataset just set rowcount prop to 1

    Thank you for your reply.

    I have created the Childbands, but somehow the RichViews are NOT on the childbands, they are on the Page (I checked it in design mode).

    I use the following code


    With FrDataSet Do
    Begin

    while not eof do
    Begin

    inc(IncNumber);
    ChildBand := tFrxChild.Create(Page);

    ChildBand.Stretched := True;
    ChildBand.AllowSplit := true;
    ChildBand.Name := 'Child'+IntToStr(IncNumber);
    ChildBand.Height := fr01cm *10;

    if IncNumber>1 then
    Begin
    (AdatForm.frxReport.FindObject('Child'+IntToStr(IncNumber-1)) as tFrxChild).Child
    := AdatForm.frxReport.FindObject('Child'+IntToStr(IncNumber)) as tFrxChild;
    End;


    RichView := TfrxRichView.Create(ChildBand);
    RichView.CreateUniqueName;

    RichView.Align := baWidth;

    RichView.Height := 0.84;
    RichView.Width := 19;
    RichView.StretchMode := smMaxHeight;

    RichView.Parent := ChildBand;


    //I won't bother you with the code where I change the rtf files
    RichView.RichEdit.Lines.LoadFromFile('_a.rtf');
    RichView.Top := fr01cm *30;


    Next;
    End;



    End;
  • gordkgordk St.Catherines On. Canada.
    edited 10:42AM
    you must set the top property for the band,
    then create the memoview within the band it's top can be 0
    then you create the next set of band and memo
  • edited 10:42AM
    gordk wrote: »
    you must set the top property for the band,
    then create the memoview within the band it's top can be 0
    then you create the next set of band and memo

    Hi,

    Thank you VERY MUCH your help. I don't know what I would have done without you. It would take weeks to figure all this out on my own.

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.