Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show progress when printing PDF file
Message
De
04/12/2003 16:59:02
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
How to show progress when printing PDF file
Divers
Thread ID:
00856094
Message ID:
00856094
Vues:
71
I create a PDF file of all reports using amyuni. This PDF is saved and made available for people to send report by email. Also I like the preview supplied by the PDF reader better than the one native to VFP.

Some reports are made up of more than one form. Printing to PDF consolidates the multiple parts into one file so there is no chance another print job will come between the two parts.

So I decided to print the PDF in all cases.

I print the PDF file using the API function ShellExecute so I do not have to worry about what PDF file reader is printing the report. When I call ShellExecute to print the PDF file control is immediately returned to VFP.

Some reports can take minutes to print. This means that the user is left in limbo wondering if the report is printing. I have had users who had enough time to print the same report more than once because they did not think it printed the first time.

I tried a simple timing loop. I timed how long the report took to create a PDF file and multiplied that time by a constant and added a bias time, say 3*nRunTime + 10 secs. I them called a thermometer type program to give a progress bar.

However this works for shorter reports not longer ones which seem to have a variable element I cannot nail down. Sometimes it is too much time - sometimes it is not enough.

Can anyone suggest another way to tell how long the report will take to print or if the report is still printing? Is there an API function which does one or both?
Best Regards
Don Simpson
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform