Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RAWPRINT5.FLL
Message
From
25/09/1999 13:37:06
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00268322
Message ID:
00268962
Views:
51
>I have downloaded the RAWPRINT5.FLL
>
>Could someone write me an exemple of how to send the
>commands bellow to printers using RAWPRINT5.FLL ?
>
>
>@0,0 say CHR(15) && to condense fonts
>@0,1 say "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Hi, Moises:

First, write your report to an ASCII file with something like
REPORT FORM myReport TO FILE myFileName.txt ASCII

Then, call RawPrint to copy the report file to the printer. I use it wrapped up in a procedure (below) that does some additional stuff; you may not want all the overhead of my procedure but anyway you can see how to use the FLL.

BTW, you can accomplish the same thing without RawPrint by using low level file functions to open and read your ASCII report file, and send each line to the printer with the ??? command.

*-------------------------------------------------------
* Procedure...: CallRawPrint
*
* Author......: Rick Borup
*
* Abstract....: Use RAWPRINT5.FLL to print an ASCII file directly to the printer.
*
* Parameters..: tcFileName - the name of the ASCII file to print
*
PROCEDURE CallRawPrint(tcFileName)
if type("tcFileName") != "C"
MESSAGEBOX("Report cannot be printed because the print " + ;
"file name is missing or invalid.", ;
MB_ICONEXCLAMATION,"Error")
RETURN
endif
local lcPrinterName
lcPrinterName = GetPrinter()
IF EMPTY(lcPrinterName)
RETURN
ENDIF
set printer to name "&lcPrinterName"
set library to rawprint5.fll additive
if !rawprint(lcPrinterName, tcFileName)
* If RawPrint returned .F. then there was an error.
MESSAGEBOX("There was an error attempting to print report " + ;
upper(alltrim(tcFileName)), ;
MB_ICONEXCLAMATION, "Error")
endif
release library rawprint5.fll
RETURN
ENDPROC && CallRawPrint()

HTH,
Rick
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform