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

referencing events after loadfromdatabase

edited March 2007 in End User
Dear all,
I need to reference the report.OnStartpage and the
report.DetailBandBeforePrint events of a report that has been loaded into a
component using Loadfromdatabase.

I explain it a bit more in the previous thread.

I am sorry to keep asking but I am really stuck and my customer is going mad
so I would really appreciate any help ASAP.

many thanks

John

Comments

  • edited March 2007
    Hi John,

    Take a look at my reply to your previous post.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2007
    Dear Nico,
    thanks for the extensive reply, but this does not really help me. It
    does answer why I was losing my event handler references.

    The reports in question are not created in Delphi, but by the end user, so I
    do not know what the report template is actually called. Even if I did, it
    is the users creating it, they have no idea about code and event handlers.

    In the delphi form is an empty report component ppReport3.
    The users create labels using the end-user reporting tool.
    In the program is a grid displaying their reports from rbItem. They select
    the report name when creating a print job.
    When they click on print, the code uses LoadFrom Database to bring the
    correct report template into ppReport3. It links the ppReport3 pipeline to
    the appropriate data source. This all works great.
    The last bit is this need to handle printing on label reels and sheets with
    different numbers of labels per sheet, without wasting labels, and knowing
    how many bandsperRecord. The code from the LabelsSkipPlusQuantity.zip looks
    to answer all of these issues. It is just making it work with these user
    generated templates.


    I was wondering about some sort of code that said:

    In the form Oncreate:

    ppreport3.template.OnStartPageEvent:= ReportOnStartpage; (whatever the
    REAL code is for this)

    Then create a generic ReportOnstartpage event.

    Then Do the same for ppReport3.template.detailbandbeforeprint.


    Can this work?

    Otherwise what is the best strategy?

    kind regards

    John

  • edited March 2007

    Use the Report.Template.OnLoadEndEvent to initialize any template properties
    and event-handlers.

    For example, you could put your proprosed code in there...

    ppreport3.template.OnStartPageEvent:= ReportOnStartpage;



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2007
    Dear Nard,
    excellent, many thanks!

    regards

    John


This discussion has been closed.