Thanks Sergey,
I just put the code in to check if STRTOFILE returns successfully. It does, every time.
I filled three reports and printed them. The first one printed, it skipped the second one, and printed the third one twice. Do you see anything else in my code that could be causing this?
>You should check if operation completed successfully
>
>lnBytesWritten = STRTOFILE(lcstring, trim(goapp.cpathshared) + "w2\" + ALLTRIM(lcyear) + '\8655out.xfdf', 0)
>
>IF lnBytesWritten = 0
> * Cannot write to the file
> * Do whatever
> ...
>ENDIF
>
>
>
>>No. Here's the code.
>>
>>* Update the xfdf file.
>>lccurdir = CURDIR()
>>CD trim(goapp.cpathshared) + "w2\" + ALLTRIM(lcyear)
>>DELETE file '8655out.xfdf'
>>CD &lccurdir
>>
>>STRTOFILE(lcstring, trim(goapp.cpathshared) + "w2\" + ALLTRIM(lcyear) + '\8655out.xfdf', 0)
>>
>>lcxfdf = trim(goapp.cpathshared) + "w2\" + ALLTRIM(lcyear) + '\8655out.xfdf'
>>
>>* Print the populated form.
>>SET CONSOLE OFF
>>SET HEADINGS OFF
>>
>>thisform.printpdf(lcxfdf)
>>
>>* Wait 10 seconds.
>> WAIT 'Printing the 8655 form...' window timeout 10
>> WAIT CLEAR
>>
>>SET HEADINGS ON
>>SET CONSOLE ON
>>
>>
>>>When you write back to the .xfdf file, do you check if operation completed successfully or failed?
>>>