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

Aborting Report Loading...

edited July 2003 in End User
Hi,
How can I abort report loading? I need to do it from OnLoadStart event (in
case it is not suitable).

Thanks,
MB.

Comments

  • edited July 2003
    One approach you might want to try is to raise an exception in that event
    and trap it in a try..except handler. There should be adequate try..finallys
    in our code so it should be safe to do this.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Well, if I raise an exception - it is being shown to the end user.
    If I call an "Abort" procedure - it works all right, but the cursor becomes
    of "Hourglass" form. And although it works as usual the cursor form is a
    little confusing.
    How can I change cursor form after Abort call?
    The following code from your methods is not working:
    Cursor := crHourGlass;
    FListView.Cursor := crHourGlass;

    Could you help me please?

    Thanks,
    MB.

  • edited July 2003
    I tried it and it worked for me using a standalone designer and also from
    the context of the main report explorer demo project:

    implementation

    uses
    ppTypes, ppUtils,
    myDataview,
    daIDE;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppReport1.Template.OnLoadStart := LoadStartEvent;

    ppDesigner1.Showmodal;
    end;

    procedure TForm1.LoadStartEvent(Sender: TObject; Stream: TStream);
    begin
    raise ETemplateLoadError.Create(ppLoadStr(47)); {'Error reading template
    from database.'}
    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.