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

OnEndPage not firing?

edited March 2002 in General
Hello Digital Metaphors

My D6Pro application uses RBEnt 6.03 with a patch from DM repairing a
problem, RP6.03 forgot to switch printers when a user selected printer,
after preview to screen, different than the default printer. The envoronment
is Win2000 with Delphi6.1 Pro.

I am printing reports with RichText controls from Pardox files. The RichText
may have protected text and if so I need to set allowChange=true at times.
In OnPageRequest I set a flag telling the RichText control's OnProtectChange
a change is allowed (otherwise the BDE issues beeps (Windows Default Sound))

Giving the RichText edit control's AllowChange=true is not strictly
necessary as the report will print correctly without it. But without it
Win2000 and XP (perhaps more) will issue many beeps and drive a user mad.

I thought I could use OnPageEnd to remove the change permission. That is, I
assumed the OnPageRequest - OnPageEnd events fired in pairs. But not so.
While reporting OnPageEnd is never called. I cannot leave the change
permission on as this would defeat the purpose for using protected text.

Any help will be appreciated.

Many thanks

Russell

Comments

  • edited March 2002
    Report.OnEndPage is triggered after a page has been filled with draw
    commands by the report engine and immediately before the page is sent to the
    output device. Try running your project on the installed (unpatched)
    RBuilder\Lib dcus and see if the OnEndPage fires. If it does fire, then
    we'll need to see why the event is not getting triggered in your patched
    source. I tested this with the applied patch to my source and it is firing
    in my simple project. Are you loading a template?- is it possible that the
    report' s OnEndPage event handler is not getting reassigned after the
    template is loaded?


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    Hello Jim

    Ah. You correctly diagnosed my error. Yes I am loading the report from a
    template.
    I had not saved the report to its database before running the report. On
    doing so the OnEndPage event is now firing.

    Thank you.

    Russell


This discussion has been closed.