Adding TppRichText dynamically to a report
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
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
This discussion has been closed.
Comments
Is there a TppPageBreak component inside the detail band? Are you using
groups? I see that KeepTogether is set to True. Is it possible that
only one RichText can fit on a page?
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com