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

RB10.09 issue - : Error reading ppReport2.OnPreviewFormClose: Invalid property

edited August 2008 in General
All

Since upgrading to 10.09 we are getting an error "Error reading
ppReport2.OnPreviewFormClose: Invalid property"

I suspect that this is because I have stopped using our custom preview and
use your in built preview form.

Is there any way to stop this error or are we going to have to open 100's of
reports and manually remove the line?

Thanks in advance.

Philip L Jackson

Comments

  • edited August 2008
    Hi Philip,

    Unfortunately the OnPreviewFormClose event was referenced in each template
    when you saved them. This means that you will either need to open and save
    each template again without this reference, manually open each template as
    text and remove the reference (with an app or by hand), or perhaps create
    another simple preview plugin that implements this event and nothing else to
    trick the templates into thinking this event is present.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2008
    Hi

    I was trying to implement your suggestion below, I added back the reference
    to myPreviewPlugin, opened up the file myPreviewPlugin, removed other
    references and added the OnClose (there was not one there previously).

    This now gives an error

    [DCC Error] MyPreviewPlugin.pas(15): E2137 Method 'OnClose' not found in
    base class

    Can you please advise what I have done wrong?

    Regards

    Philip L Jackson



    code snippett.....

    unit MyPreviewPlugin;
    interface
    uses
    Classes, Controls, ExtCtrls, Graphics, Buttons, ppPreview, ppTypes ,
    Forms,
    ppComm, ppProd, ppViewr , ppUtils, ppRTTI, Dialogs, SysUtils, ppPDFDevice;
    type
    TMyPreviewPlugin = class(TppPreview)
    private
    protected
    procedure OnClose(Sender: TObject);override ;
    public
    end;


    implementation
    uses ppPreviewIcons, ppDesignerForms, ppForms, OpeningDM, Purchase,
    Delivery;

    procedure TMyPreviewPlugin.OnClose(Sender: TObject);
    begin
    inherited OnClose(Sender);
    end;


    initialization
    TppPreviewPlugIn.Register(TMyPreviewPlugin);

    finalization
    TppPreviewPlugIn.UnRegister(TMyPreviewPlugin);

    end.





  • edited September 2008
    Hi Philip,

    I apologize if I was confusing. When the template is loaded, it is looking
    for an event named ppReport2.OnPreviewFormClose which is an event of the
    actual report object. My guess is that when the template were originally
    created, they were done so with a report named ppReport2 and the event
    OnPreviewFormClose was implemented somewhere in the app.

    The only way to work around this issue would be to manually edit the
    template files and remove this reference or "trick" the templates to
    thinking the same report object and event are still present by making sure
    you load them into ppReport2 with the OnPreviewFormClose event implemented.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    Hi

    Some of the blob data in rbItem table is in Binary format, not ASCII.

    Have you a quick way of loading the binary and saving back into the table as
    ASCII? I can then parse the values and remove the line.

    Regards

    Philip L Jackson


  • edited September 2008
    Hi Philip,

    Take a look at the following example. This shows how you can edit a
    template as text from blob data stored on your DB.

    http://www.digital-metaphors.com/tips/EditTemplatesAsText.zip

    --
    Regards,

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

    Best Regards,

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