Creating RichViews on the fly positioning problem
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
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
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).
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;
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.