ppRichText and Endless printing problem solved
After many frustrating hours of problems with the ppRichText component. I
finally solved the problem of the component causing an endless print loop.
So Team DM put this in you archives.
I set the report and subreport (to which the component belongs ) PassSetting
to TwoPasses. That alone doesn't solve anything. I also set the Mailmerge to
True even though there are no fields in the component; the component is
empty (nothing hard coded) until it is populated programatically. This seem
to force the component to properly check and calculate pagination.
finally solved the problem of the component causing an endless print loop.
So Team DM put this in you archives.
I set the report and subreport (to which the component belongs ) PassSetting
to TwoPasses. That alone doesn't solve anything. I also set the Mailmerge to
True even though there are no fields in the component; the component is
empty (nothing hard coded) until it is populated programatically. This seem
to force the component to properly check and calculate pagination.
This discussion has been closed.
Comments
in the event handlers? Perhaps the text is inifinitely being assigned?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
(although it's subreport is set for two passes).
Also after making the settings as described, the settings for the Font and
size were no longer valid. Here's where they were:
With ppRichText1 do
begin
SelAttributes.Size := 10; <------------------------****
SelAttributes.Name := 'Arial';<----------------------****
iEnd := Length( RichText );
{ Set the Name of the state to bold }
for I := 0 to slStateList.Count -1 do
begin
if SelLength <> 0 then
iStart := SelStart + SelLength
else
iStart := 0;
lFoundAt := FindText( slStateList[I],iStart,iEnd,[]);
SelStart := iStart;
SelLength := lFoundAt;
SelAttributes.Style := [];
if lFoundAt <> -1 then
begin
SelStart := lFoundAt;
SelLength:= Length(slStateList[I]);
SelAttributes.Style := [fsBold,fsItalic];
end; // lFoundAt
end; // slStatelist
{ Set the Style for the remaining text }
iStart := SelStart + SelLength ;
SelStart := iStart;
SelLength:= iEnd;
SelAttributes.Style := [];
end;
And here's where I had to put them:
With ppRichText1 do
begin
iEnd := Length( RichText );
{ Set the Name of the state to bold }
for I := 0 to slStateList.Count -1 do
begin
if SelLength <> 0 then
iStart := SelStart + SelLength
else
iStart := 0;
lFoundAt := FindText( slStateList[I],iStart,iEnd,[]);
SelStart := iStart;
SelLength := lFoundAt;
SelAttributes.Style := [];
if lFoundAt <> -1 then
begin
SelStart := lFoundAt;
SelLength:= Length(slStateList[I]);
SelAttributes.Style := [fsBold,fsItalic];
end; // lFoundAt
end; // slStatelist
{ Set the Style for the remaining text }
iStart := SelStart + SelLength ;
SelStart := iStart;
SelLength:= iEnd;
SelAttributes.Style := [];
SelectAll; <----------------------------------------****
SelAttributes.Size := 10;<----------------------------****
SelAttributes.Name := 'Arial';<-----------------------****
end;