General information
Category:
Windows API functions
Ed,
I've been trying to resolve this problem all day. Being a VFP novice I'm not having a lot of luck. When I pass the string to the function call I don't get any error messages; However, I get multiple copies of the entire report. The following is my code so far.
declare PEOpenEngine in CRPE32.dll
declare PEPrintOptions in CRPE32.dll
declare integer PEOpenPrintJob in CRPE32.dll string
declare PEEnableProgressDialog in CRPE32.dll integer, integer
declare PEOutputToWindow in CRPE32.dll integer, string, integer, integer, integer, integer, integer, integer
declare PEOutputToPrinter in CRPE32.dll integer, string @PEPrintOptions
declare PEStartPrintJob in CRPE32.dll integer, integer
declare PEClosePrintJob in CRPE32.dll integer
declare PECloseEngine in CRPE32.dll
#include \TurnKey4\CRPE.H
local m_JobID, StartpageN, StoppageN, NumReportCopies, CollationValue, FilePath
StartpageN = 1
StoppageN = 1
NumReportCopies = 2
CollationValue = 0
FilePath = ""
PEPrintOptions = NumToWord(10 + PE_FILE_PATH_LEN) + ;
NumToWord(StartpageN) + ;
NumToWord(StoppageN) + ;
NumToWord(NumReportCopies) + ;
NumToWord(CollationValue) + ;
PADR(FilePath, PE_FILE_PATH_LEN, CHR(0))
PEOpenEngine()
m_JobID = PEOpenPrintJob("\TurnKey4\Printouts\Report.rpt")
PEEnableProgressDialog(m_JobID, 0)
PEOutputToPrinter(m_JobID, @PEPrintOptions)
PEStartPrintJob(m_JobID, 1)
PEClosePrintJob(m_JobID)
PECloseEngine()
FUNCTION NumToWORD
*
* Creates a C USHORT (WORD) from a number
*
* Parameters:
*
* tnNum (R) Number to convert
*
LPARAMETER tnNum
*
* x holds an int
*
LOCAL x
x=INT(tnNum)
RETURN CHR(MOD(x,256))+CHR(INT(x/256))
Do you see any problems or have any suggestions?
Thanks
Mark Parker
MAP Software, Inc.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only