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?
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.
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.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.