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

Variable Initialization?

edited June 2004 in RAP
If using global variables to accumulate counts to be shown in the Summary
band, in what event should they be initialized so that both Print and
Preview start with the proper values? Should this be Report.OnBeforePrint or
Report.OnStartFirstPass?

Regards,
Tom

Comments

  • edited July 2004

    Try using TppVariable components to accumulate totals. Variable components
    contain the ability to save/restore their intermediate results as of the
    end/begin of each page. The Variable OnCalc event is designed to be a good
    place to perform calcs.

    If you still feel that you need to use code based variables, try using the
    Global OnCreate event to initialize variables. From the Calc tab select View
    | Module.



    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2004
    Nard:

    Thanks for the information. Does a list exist anywhere that shows the events
    and the order in which they fire?

    Tom

  • edited July 2004
    Never mind. I found the demo that shows how the report events fire.


    Tom

  • edited July 2004

    Great, I was going to point you towards those demos.

    The Global OnCreate/OnDestroy events fire slightly differently when a report
    is previewed from the Designer's Preview tab versus when a report is printed
    to the Preview Dialog. AutoSearch also works slightly differently in these
    environments as well.

    The RBuilder\Demos\Rap\CodeSite example contains a set of pass-thru
    functions that enable you to use the CodeSite debugger with RAP. CodeSite is
    available from Raize Software.


    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

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