Home General

Adding TppRichText dynamically to a report

edited May 2011 in General
I'm trying to add a TppRichText to a report at runtime. Everything is
working ok, except it always puts a page break on the report after the
detail band. So, it winds up so that every record, except the very
first one is on its own page. What am I doing wrong here? My code is
below:

for i := 1 to mmo.Lines.Count - 1 do
begin
if Trim(mmo.Lines[i]) <> '' then
begin
cmpName := ReplaceStr(opt, ':', '');
cmpName := 'rtf' + ReplaceStr(cmpName, '.', '');

if not Assigned(FindComponent(cmpName + IntToStr(i))) then
begin
reTmp := TppRichText.Create(rptOutput.Owner);
reTmp.Name := cmpName + IntToStr(i);
reTmp.Tag := 2011;
reTmp.Band := sndr.Band;
reTmp.Left := sndr.Left;
reTmp.Width := sndr.Width;
reTmp.Visible := True;
reTmp.Stretch := True;
reTmp.KeepTogether := True;
reTmp.Transparent := True;
reTmp.BottomOffset := 0.1;
end else
reTmp := TppRichText(FindComponent(cmpName + IntToStr(i)));

if i = 1 then //first extra one
reTmp.ShiftRelativeTo := rtfDetails
else
reTmp.ShiftRelativeTo := TppRichText(FindComponent(cmpName +
IntToStr(i - 1)));
end
end

Comments

This discussion has been closed.