WeeStinker
asked on
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:
try
ExporttoPDF(QuickRep1,str) ;
except
rdpshowinfo('An error occurred exporting the file '+str);
end;
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 ?
The code:
try
ExporttoPDF(QuickRep1,str)
except
rdpshowinfo('An error occurred exporting the file '+str);
end;
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 ?
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.
ASKER
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
begin
RDPShowInfo('The file '+str+' already exists. PotC will attempt to delete it and recreate it');
delRes:=deletefile(str);
if delres=false then
begin
RDPShowInfo('PotC was unable to delete the file '+str);
exit;
end;
RDPShowInfo('PotC has deleted the existing file '+str);
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
I have emailed qusoft as you suggested.