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

Fill a TppRichText at runtime

edited July 2003 in General
Hi !

I'm new to ReportBuilder (use Demo v7.02) and I want to know wich event to
use to fill my
TppRichText (on a TppDetailBand) at runtime. If I use the BeforePrint event
of the TppDetailBand or the OnPrint of the TppRichText, everything is OK on
the preview form (called with the Print method of TppReport), but when I
print after the preview, the content of the TppRichText is duplicated (I
think the events are fired twice).

Sure I can use the Clear method of my TppRichText at the beggining of the
event, but it's just a "patch" wich I don't like to use...

So, wich event is fired once (even if I print after a preview) ?


By the way, ReportBuilder is soooo better than QuickReport !

Anyone can help me ?
Thanks !

Comments

  • edited July 2003
    Hi !

    I forgot:
    The TppRichText is filled for each records of the database...

    Thanks !?

  • edited July 2003
    Hi,

    Thanks for evaluating ReportBuilder. The BeforePrint and OnPrint events
    will fire more than once during report generation. Try clearing the
    TppRichText.RichText property before you add text to it from your database.
    This way you will not be printing duplicate information every time the event
    fires.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2003
    Hi !

    (Your support is also better that QuickReport.)

    I know, but I want to know how to avoid this. If I use a long treatement to
    fill my TppRichText into TppDetailBand.BeforePrint event and if I use a
    TppRichText.Clear at the beggining of the event everything is OK in the
    preview ant in the printed copy, but the long treatment is duplicated and
    the performance is affected...

    The text into the TppRichText changes for each records of the database. I
    want to know if theres an event fired only once per record even when I print
    after a preview... When I must fill my TppRichText ??

    Thanks a lot !


  • edited July 2003
    Hello,

    There is not an event available that will only fire once per record. You
    can still use the DetailBand.BeforePrint event and instead of clearing the
    RichText control, you could check to see if the information you want to
    insert is the same as the information already inside the TppRichText. Then
    you can only change the RichText component when the information is different
    without loosing any performance.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2003
    Hi again !

    Thanks for your help ! I finally got a solution. I use the
    TppRichText.OnPrint event to fill my TppRichText for each records of the
    database. I'm also forced to put a TppRichText.Clear at the beggining of the
    event. I don't like it but I think it's the only solution...

    Nico Cizik, as a Digital Metaphors employee, do you find that my solution is
    odd ? Just want the advice of a ReportBuilder expert...

    Thanks !


  • edited July 2003
    That's how I would do it :).

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.