Hello,
I have been trying to get the lines of code that I found in faq184-2919 to work correctly.
I put the following lines of code into a program called myfunction.prg.
Then on my form's PRINT command button click event I put the following lines of code:
In the LOAD procedure for my form I put the following lines of code:
In the UNLOAD procedure for my form I put the line of code to release the PUBLIC variable lPrinted:
In my report form's ON EXIT portion of the summary band I tried putting the following line of code:
When I try to rebuild my VFP9 project I get the following error message:
Report c:\foxpro1\reports\by_ticket_number.frx has the following errors:
Unknown MYFUNCTION - Undefined
If I change the line of code in the ON EXIT portion of the report summary band to just:
The VFP9 project will rebuild and compile without any errors, but when I run the resulting executable program and click on my PRINT command button I get the following error message:
Variable 'MYFUNCTION'is not found.
I've even tried putting this line of code into the ON EXIT portion of the report summary band:
The VFP9 project will rebuild and compile without any errors, but when I run the resulting executable program and click on my PRINT command button I get the following error message:
Syntax error.
Can any of you look at my lines of code and tell me what I'm doing wrong?
I'm not familiar with using or calling UDF's in a report, so any help would be appreciated.
Thanks.
I have been trying to get the lines of code that I found in faq184-2919 to work correctly.
I put the following lines of code into a program called myfunction.prg.
Code:
FUNCTION PRINTED
IF WEXIST("Printing...")
lPrinted = .T.
ENDIF
ENDFUNC
Then on my form's PRINT command button click event I put the following lines of code:
Code:
nTotalPages = 0
REPORT FORM c:\foxpro1\reports\by_ticket_number.frx noconsole
nTotalPages = _pageno
lPrinted = .F.
REPORT FORM C:\foxpro1\reports\by_ticket_number TO PRINTER PROMPT NOCONSOLE
IF lPrinted = .T.
MESSAGEBOX("The Monthly Report by Ticket Number was sent to the printer that you selected.",0+64,thisform.caption)
ELSE
MESSAGEBOX("The Monthly Report by Ticket Number was cancelled.",0+64,thisform.caption)
ENDIF
In the LOAD procedure for my form I put the following lines of code:
Code:
PUBLIC lPrinted
SET PROCEDURE TO c:\foxpro1\progs\myfunction.prg
In the UNLOAD procedure for my form I put the line of code to release the PUBLIC variable lPrinted:
Code:
RELEASE lPrinted.
In my report form's ON EXIT portion of the summary band I tried putting the following line of code:
Code:
myfunction()
When I try to rebuild my VFP9 project I get the following error message:
Report c:\foxpro1\reports\by_ticket_number.frx has the following errors:
Unknown MYFUNCTION - Undefined
If I change the line of code in the ON EXIT portion of the report summary band to just:
Code:
myfunction
The VFP9 project will rebuild and compile without any errors, but when I run the resulting executable program and click on my PRINT command button I get the following error message:
Variable 'MYFUNCTION'is not found.
I've even tried putting this line of code into the ON EXIT portion of the report summary band:
Code:
Do myfunction
The VFP9 project will rebuild and compile without any errors, but when I run the resulting executable program and click on my PRINT command button I get the following error message:
Syntax error.
Can any of you look at my lines of code and tell me what I'm doing wrong?
I'm not familiar with using or calling UDF's in a report, so any help would be appreciated.
Thanks.