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

Wich event to use to move visual objects in report

edited July 2003 in General
Hi !

I am making a report wich have many stretching components. Theres also
"optionnal" components (sometimes theres a photo sometimes not). I must move
my reports components dynamically at run-time. Wich event is the best for
that ? I tryed the BeforePrint event but the TppRichText with Stretch = True
are filled but they didn't stretched yet, making my "moves" impossibe...

Anyone can help ?

Thanks a lot !

Comments

  • edited July 2003
    Hi,

    By using Regions, you may not have to move any components at runtime.

    Try placing your components in TppRegions with their ShiftRelativeTo
    properties set to any corresponding Regions above or below them. Using the
    ShiftRelativeTo property will cause the TppRegion below any region without
    any information to snap up and fill the absent region's space.

    --
    Best Regards,

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

    2 more sub-questions:

    1) TppRegion is great, but why we can put regions into regions (I think it's
    impossible) ? If not, how to to that ?

    If you don't understand why I want to put a TppRegion into another, let me
    explain... I use ReportBuilder to print collector's items. Items can have or
    not a picture attached to it. The picture can be up to 320*258 pixels (may
    be less but not more). Left to the optional picture (TppImage), I have a
    TppRichText wich is also dynamic (Stretch = True). Under the "taller"
    (biggest Height among the TppImage or TppRichText) object, I have another
    TppRichText with some other text. So my first (the one at the left of my
    TppImage) TppRichText.Left depends of the Width of my TppImage and my second
    TppRichText.Top depends on the "tallest" object among my first TppRichText
    and my TppImage. I hope you'll understand what I want to do...

    2) I don't want any borders on my TppRegion. Is the only wat to do that is
    to put TppRegion.Pen.Color the same color as the report color ?

    Thanks a lot for the great support !!


  • edited July 2003
    Another one:

    3) Why we can't use a TppImage in the ShiftRelativeTo property ?


    "TheWolf1" a ?crit dans le message de
  • edited July 2003
    Hello,

    1. Sorry but nested regions are not supported in ReportBuilder. As a
    work-around, try placing a subreport either in place of a region with the
    regions inside the subreport, or inside an existing region acting as a
    nested region. Be sure you use Child style subreports.

    2. To disable the borders of a TppRegion, simply set TppRegion.Pen.Style :=
    psClear; This can be done in code or in the Object Inspector in Delphi.

    --
    Best Regards,

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

    The only components available with the ShiftRelativeTo property are
    descendents of the TppStretchable class. This implies that they are not
    static objects. The TppImage is a static object and therefore can only
    shift with it's parent using the ShiftWithParent property. If you need to
    shift an image relative to another stretchable object, you will need to
    place the image inside a TppRegion or TppSubreport.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2003
    1) I don't work I don't understand how to use a subreport correctly... Is
    there something that I miss ? Is there some examples downloadable ?

    Thanks !

  • edited July 2003
    I figured it out ! Thanks Nico Cizik !!


    "TheWolf1" a ?crit dans le message de
  • edited July 2003
    Hi again !

    One last question before my report is complete:

    I use oftem TppRichText in my report.
    1) I have a 100 pixels width TppRichText.
    2) I fill this TppRichText with some RTF text.
    3) I want to adjust the width (expand or reduce width) of my TppRichText to
    fit the longest line of RTF contained in the TppRichText.

    Is that possible to do that ? If yes, how ?

    Thanks !


    "TheWolf1" a ?crit dans le message de
  • edited July 2003
    Hello,

    Try to get this working in Delphi without ReportBuilder first, then move it
    to RB. You will need to use a TRichEdit component and find the length of
    the longest line in your RichText document by using the SelStart, SelLength,
    and SelAttributes properties. Then you could adjust the TRichEdit component
    accordingly. The same will apply to the ReportBuilder TppRichText component
    when you port it over.

    --
    Best Regards,

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