Solved

Delphi 7 and QuickReport ExporttoPDF function

Posted on 2007-11-16
4
648 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

919 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

19 Experts available now in Live!

Get 1:1 Help Now