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

Cant print 2 different Tpprichtext w/mailmerge

edited December 2009 in General
Hi:

im using D7 with Rbuilber 10.06

im trying to print two different tpprichtext with mailmerge active, the
trick is that report has to print one or another depending of the value of a
field, im using the following code:

procedure TFcartas.ppDetailBand6BeforeGenerate(Sender: TObject);
begin
ppRichText2.visible := (VrecordatoriosIDIOMA.asstring = 'I');
ppRichText1.visible := (VrecordatoriosIDIOMA.asstring <> 'I');
end;


but it seems that only the first one that is used by the program is the only
one printed, the other one is never printed, it shows only a blank space
where the text should be.


What im doing wrong?


TIA

Comments

  • edited December 2009
    Please use your full name.


    Hard to say.

    Did you try the OnBeforePrint event?

    Also, try the following code:

    ppRichText2.visible := True;
    ppRichText1.visible := not ppRichText2.visible;

    Does it work correctly? And how about the following:

    ppRichText2.visible := false;
    ppRichText1.visible := not ppRichText2.visible;

    Does that print correctly?

    Ed Dressel
    Team DM

  • edited December 2009


  • edited December 2009


    sign your posts and change the settings of your new reader.


    I'm not understanding. Is there a condition when both might be printed?
    (Your code is either one or the other).
  • edited December 2009

  • edited December 2009
    create a demo and send it to support (you could send it to me but I will be
    out of the office tomorrow).

    Ed Dressel
    Team DM
  • edited December 2009
    Im not sure how to build you a demo there is to much involved to execute
    that report, it uses a mysql database with a very complex query.

    I have more information that maybe gives you an idea about how to help me to
    solve my problem...

    1.- I recall the reporte was working fine until i installed Teechart
    components.
    2.- If i modify the query to get only records that match
    VrecordatoriosIDIOMA.asstring='I' and execute the report the corresponding
    ppRichtext prints ok; if i close the application and open it again and try
    with records (VrecordatoriosIDIOMA.asstring<>'I') the other ppRichtext
    prints ok too, but if i try to do it without closing the application, only
    prints the ppRichtext that correspond with the first record readed.


    Because im desperate, im trying another workaround, im trying with only one
    ppRichtext and filling it with the appropiate text, but it seems ppRichtext
    does not support UFT8 character set, i cant print Ñs or hyppen letters (my
    text is in spanish), instead of that i got funny characters.

    Any Ideas?

    Willo Berguer



  • edited December 2009




    You could dump the data to a TClientDataSet. Or you could use the DBDemos
    data.


    That would not affect RichText.


    Try calling Report.Reset prior to calling Report.Print



    TppRichText is a wrapper for the Delphi TRichEdit component, which is a
    wrapper for the Windows RichEd dll. I recommend using an RTF editor to edit
    the RTF data. If you read the RTF specification you will find that RTF data
    is always saved as Ansi, though it can contain Unicoded encoded data. This
    is done by escaping the Unicode code characters, something like
    \U+CodePoint.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com






    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Sent you a demo on Jan/01, it was made with D 7 Ent and Rbuilder 10.06. It
    is using customer table at DBDemos

  • edited January 2010
    Please try resending the example, we never received it.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Done... i sent it to support@digital-metaphors.com; please acknowledge...

  • edited January 2010
    Nothing has been received. Are you sending a .zip file?

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    yes...

  • edited January 2010
    As a test, try sending a simple email message to support@ that has no
    attachment.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Id tried with a different account; maybe gmail does not support zip files.


  • edited January 2010
    The email has been received. This issue is in the queue to be looked at and
    I will post a follow up here.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    The example you submitted works correctly using RB 11.06. Try downloading an
    RB 11 trial version from our web site and perform the same test.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Already done;

    it works on RB 11

    but also WAS working on RB 9 and RB 10, thats the weird thing in this.
    Upgrading is not possible now, we'll try to find a workaround. Thanks anyway
    for you time.


  • edited January 2010
    Try updating to RB 10.09, perhaps that will work better. To request download
    info, send your serial number and registration details to
    info@digital-metaphors.com. Please do not use gmail or other free email
    accounts.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.