Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking file/print status 1

Status
Not open for further replies.

fkwong

Programmer
Jul 5, 2002
65
0
0
US
I have a program that will first generate a PDF file and then run another REPORT FORM command to preview the report. Is there a way to check the status of the PDF file and make sure it is completed before I continue the next command?

Thanks in advance.
 
fkwong,

Not sure I understand this. You say you want to use REPORT FORM to preview the report but you need to wait until the PDF has been created for that. Why?

If you want to preview the report in the native VFP report preview window, that won't depend on the PDF being availablle.

If you want to call up a PDF viewer to view the PDF you have just created, then you do indeed need to wait. How are you creating the PDF? If you are "printing" to a PDF driver, check the driver documentation. It might have an option to automatically load the PDF when it has finished creating it.

Mike


Mike Lewis
Edinburgh, Scotland
 
I am using third party PDF driver to create a PDF file, so I have to issue SET PRINT TO NAME PDFDriver and then REPO FORM command to create a PDF file. The issue is I cannot tell if the file is completedly created befire I continue...

The next part of the program is I have to set the printer back to the VFP printer and issue a REPO FORM command to let the user preview the same report. By doing this, it create problem because the PDF file I try to create may not be completedly done yet.

So, what I need is to be able to check the status of the PDF file and not to continue the program until I am sure that the file is completed done.

Thanks

Thanks
 
fkwong

Use the low-level function FOPEN() to determine if the .pdf is complete :-

DO WHILE .T.
[tab]lnNo = FOPEN([path\filename.pdf],0)
[tab]IF lnNo = -1
[tab][tab]FCLOSE(lnNo)
[tab]ELSE
[tab][tab]FCLOSE(lnNo)
[tab][tab]EXIT
[tab]ENDIF
ENDDO


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top