Delphi 7 and QuickReport ExporttoPDF function

My users are getting periodic access violations when my software tries to use the ExportToPDF function (part of Gnostice's QuickReport form Delphi 7).

The code:
        rdpshowinfo('An error occurred exporting the file '+str);

thorws up an access violation now and again. Any ideas? I have tried everything but can't get this resolved. Also, if it is going to happen periodically, what is the best was to code in multiple retries ?
Who is Participating?
LimbeckConnect With a Mentor Commented:
can you reproduce the error or does it happen every now and again using the same report; same pc; same data? if so might just be a memoryproblem; i did have a lot of strange problems with quickreport that were solved using a diff computer with more memory.

you can always try contacting qusoft (since you use exporttopdf i take it you have a license there)
is it possible the user already has a file at location str and that that file is opened by him/her? i did have a similar situation with users who would create a report; open it in acrobat; see somethign that is wrong and regenerate the same report without closing acrobat.
WeeStinkerAuthor Commented:
Thanks for your quick reply. Prior to attempting to create the PDF, the program checks to see if file str exists and if it does it deletes it. If it was in use, it would produce a different message to the access violation that I am getting.
    if fileexists(str) then
        RDPShowInfo('The file '+str+' already exists. PotC will attempt to delete it and recreate it');
        if delres=false then
            RDPShowInfo('PotC was unable to delete the file '+str);
        RDPShowInfo('PotC has deleted the existing file '+str);

Open in new window

WeeStinkerAuthor Commented:
I cannot reproduce it at all on my own PCs. My client has approx 15 users and most of these have had this error at some stage. It is intermittent, happening maybe 10% of the time. The PDFs being created are all proforma invoices and it can happen with different ones.

I have emailed qusoft as you suggested.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.