Home Component Writing

Custom Band

edited February 2007 in Component Writing
Hi,

What are the steps required to register a custom band that inherits from
TppSummaryBand.

Thanks

Comments

  • edited February 2007

    The architecture is open to adding custom RCL components that appear on the
    Designer's component palette. For a simple example, check out
    RBuilder\Demos\RCL.

    Try to accomplish what you need by making a custom component, rather than a
    band. A component that descends from TppStretchable can dynamically stretch
    its height and overflow to additional pages - therefore it is much like a
    band. Descendants of Stretchable include Memo, RichText, Region, Subreport,
    and Crosstab. For an example check out RBuilder\Source\ppMemo.pas

    The architecture is currently /not/ designed to accomodate adding custom
    bands.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2007
    Thanks.

    I was trying to implement the Summary Align Bottom example by creating my
    own descendent from TppSummaryBand, rather than adding all the code in every
    report. In the end I created a RAP procedure that we call from the
    SummaryBeforePrint event and the called code assigns the OnDrawCommandCreate
    event as well as the AfterPrint event to the Summary components.

    How could I use this approach to force the summary band contained in a
    subReport to force that summary band to print at bottom of page.

  • edited February 2007

    Thanks for the details, now I understand better, you really are trying to
    change the behavior of the summary band.

    - one option would be to use the Report.Template.OnLoad event to assign the
    SummaryBand.BeforePrint and AfterPrint event-handlers etc and manage things
    from there. Sort of like a common set of event-handlers to manage
    everything.

    - the next step up from that would be to create a SummaryBandController
    component that has a SummaryBand property. You set the property and assigns
    the event-handlers and manages things. (Same as above, but the code is
    encapsolated in the SummaryBandController class so its cleaner.

    - another option would be to try creating SummaryBandController that works
    similar to the TppPageBreak, which does not itself generate any output. Your
    custom component could be placed in the summary band and attach the
    event-handlers and manage things that way.

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

    Best regards,

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