Solved

Delphi 7 and QuickReport ExporttoPDF function

Posted on 2007-11-16
4
645 Views
Last Modified: 2010-08-05
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 ?
0
Comment
Question by:WeeStinker
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Limbeck
ID: 20297063
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.
0
 

Author Comment

by:WeeStinker
ID: 20297073
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;

Open in new window

0
 
LVL 19

Accepted Solution

by:
Limbeck earned 500 total points
ID: 20297121
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)

http://www.quickreport.co.uk/supportform.html
0
 

Author Comment

by:WeeStinker
ID: 20297189
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now