Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

ppRichText and Endless printing problem solved

edited August 2001 in General
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.

Comments

  • edited August 2001
    This is interesting. Thanks for pointing this out. Also, what is happening
    in the event handlers? Perhaps the text is inifinitely being assigned?

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Haven't checked that out, but what would cause that to happen?


  • edited August 2001
    Now the OnPrint event of the ppRichText component passes through three times
    (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;




This discussion has been closed.