Created at runtime: Memos not added to their 'parents'
Hello FR Gurus.
I am creating a report at runtime, and while the report looks tidy when I send it to PDF, when I preview it in the designer it all goes awry.
Here is a part of the code where I create the PageHeader:
I am creating a report at runtime, and while the report looks tidy when I send it to PDF, when I preview it in the designer it all goes awry.
Here is a part of the code where I create the PageHeader:
CreateStandardHeader(Title: String);
var
Line : TfrxLineView;
begin
fPageHeader := TfrxPageHeader.Create(fPage);
fPageHeader.CreateUniqueName;
fPageHeader.Stretched := TRUE;
//Company
With TfrxMemoView.Create(fPageHeader) do
Begin
CreateUniqueName;
Align := baLeft;
AutoWidth := TRUE;
HAlign := TfrxHAlign.haLeft;
SetBounds(0,4,0,30);
StretchMode := smActualHeight;
Text := dk_db.CurrentGeCompanyObject.CompanyId.AsString + ' - ' +
dk_db.CurrentGeCompanyObject.Name.AsString + NewLineChar +
FormattedDateTime(Now);
End;
//Title
With TfrxMemoView.Create(fPageHeader) do
Begin
CreateUniqueName;
Align := baCenter;
AutoWidth := TRUE;
HAlign := TfrxHAlign.haCenter;
SetBounds(0,4,0,20);
StretchMode := smActualHeight;
Font.Size := 10;
Font.Style := [fsBold];
Text := Title;
End;
Line := TfrxLineView.Create(fPageHeader);
Line.CreateUniqueName;
Line.Top := 35;
Line.Align := baWidth;
end;
But as you can see from the screenshots, the pageHeader stands alone, and the Memos are not added (i.e. Memo1, Memo2)
Comments
Hi Gisli,
You might want to try setting the Top property of the various bands so they come after each other (i.e. Title, Header, Databand) something like this :-
Hope this helps,
Regards,
Andy
Gisli