Welcome! Log In Create A New Profile

Advanced

Hung application after report failure

Posted by norfolk-reg 
Hung application after report failure
January 14, 2021 03:12PM
Hi,

WD22.

The reports in my application are written out to PDF files in a specified folder. This all works fine normally, but if for some reason the intended folder is not available (due to network security etc) then the report simply stops. Not a problem in itself because I check for the PDF file's existence in my application, but the pop up "Printing ..." window does not close and keeps focus, so the application effectively hangs.

Can I either
1. Stop the "Printing ..." window from appearing at all when I'm running reports OR
2. Get it to close if the reports simply stops/aborts.

I've tried using both the Case Exception and Case Error features to close the report, this has no effect.

Kind Regards
Reg
Re: Hung application after report failure
January 14, 2021 04:27PM
Hi Reg

Running your reports on a separate thread can be a resolution to resolve this.
On that thread you can have a time-out that would kill any hanging report generation after a certain time.

That way you will no longer block the main thread.

My 2 cents

Peter Holemans
Argus
Re: Hung application after report failure
January 14, 2021 06:45PM
I suggest:

1. check for the directory availability BEFORE printing
2. The 'printing' window is not the problem... You can NOT display it, but the printing will still hand
3. On top of a separate thread, you can also try to open a SISTER window and print from there... As this window is NOT modally locked with your regular one, only the printing part should be locked.

But the main point is 1...
Re: Hung application after report failure
January 14, 2021 07:25PM
Hi,

I like the idea, but for certain reports I really need the user and my application to know the report has successfully completed before progressing.

Thanks for the idea though ,for some longer running reports I will use that approach.

Cheers
Reg
Re: Hung application after report failure
January 14, 2021 07:28PM
Hi,

Yes, I could check the directory before running the report, although it wouldn't absolutely guarantee that the folder would still be available moments later when the report itself tried to run.

I'm interested in the fact that the printing window can be suppressed though in any case, could you please point me in the right direction as to hwo to experiment with that?

Cheers
Reg
Re: Hung application after report failure
January 14, 2021 09:23PM
Hi Reg

Aside of all the other hints mentioned before you might want to generate the file locally in fTemp of the user and when it finished do an fCopy to the share which you can test at that time if it ran successfully.

Just some more ideas

Cheers

Peter H.
Re: Hung application after report failure
January 15, 2021 10:26AM
Hi Peter,

Thanks for that idea smiling smiley

Cheers
Reg
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: