TdosPrn con Preview e impresoras laser
Ji,ji,ji... buena la cosa... "all you need is code"
http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
Re: TdosPrn con Preview e impresoras laser
Pueden volver a subirlo por favor???
Re: TdosPrn con Preview e impresoras laser
http://rapidshare.com/files/187515980/A ... ersion.zipfaraon wrote:Pueden volver a subirlo por favor???
Anser
Re: TdosPrn con Preview e impresoras laser
Muchas gracias anserkk...
Re: TdosPrn con Preview e impresoras laser
anserkk / ralph / adolfo:
podrian volver a subir el archivo
Estoy interesado en usar esta clase para imprimir en puerto lpt1 / usb / impresora remota
Gracias
podrian volver a subir el archivo
Estoy interesado en usar esta clase para imprimir en puerto lpt1 / usb / impresora remota
Gracias
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
Re: TdosPrn con Preview e impresoras laser
Pueden descargar desde aqui: http://www.solupymes.com/fwin/tdosprevn.zip
Ralph del Castillo
Lima PERU
Fwh 17.09, xHb123_10193, MySQL 5.5, BCC 7.3
Lima PERU
Fwh 17.09, xHb123_10193, MySQL 5.5, BCC 7.3
Re: TdosPrn con Preview e impresoras laser
Gracias, Ralph
hare pruebas y te cuento
hare pruebas y te cuento
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
Re: TdosPrn con Preview e impresoras laser
anserkk wrote:http://rapidshare.com/files/187515980/A ... ersion.zipfaraon wrote:Pueden volver a subirlo por favor???
Anser
Anser
Buenos días, podrías enviarme tu clase modificada ?, mi correo es ltorreslm@hotmail.com.
Gracias
Re: TdosPrn con Preview e impresoras laser
MUCHAS GRACIAS !!!!!!!!
Re: TdosPrn con Preview e impresoras laser
ANSER
i dont get to print over printer with USB port
It creates only files in memory but dont print
Here this my code
you can try my code with your program and tell me if you get to print over usb printer
i hope that you can help me
thanks
i dont get to print over printer with USB port
It creates only files in memory but dont print
Here this my code
Code: Select all
#include "FiveWin.ch"
#include "report.ch"
#define HKEY_LOCAL_MACHINE 2147483650
Function Atest()
@ 2, 12 BUTTON oBtn2 PROMPT "&Texto" OF oDlg SIZE 40,12 ;
ACTION TestRep( .t., oDlg)
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
/--------------------------------------------------------------------------
static function TestRep( lModal, oDlg)
local oPrn, cTitulo
local nLin, nLinMax, nPag, cTmp, nItens
SET _3DLOOK ON
SetMTxtPreview( .f., 5, 2, .f., .t. )
cTitulo:= "**** TEST DE TTXTPREVIEW ****"
USE TEST2
GO TOP
nLin := 1
nPag := 0
nItens := nTotal := 0
oPrn:= TDosPrn():New(.t.) // .T. bota error de variable no existe HKEY_LOCAL_MACHINE
if ! oPrn:lCancel
begin sequence
oPrn:StartPage()
do while !Eof()
//--- Cabecalho
//
if nLin = 1
nPag++
oPrn:Command( oPrn:cNormal )
oPrn:Say( nLin, 00, PadC( cTitulo, 79 ) )
oPrn:Command( oPrn:cCompress )
++nLin
oPrn:Say( ++nLin, 01, "LISTA DE FUNCIONARIOS" )
oPrn:Say( nLin, 124, "Pag.: " + StrZero( nPag,3 ) ) // Pagina
//oPrn:Say( ++nLin, 001, Repl("-", 160) )
oPrn:Say( ++nLin, 001, Repl("-", 130) )
oPrn:Say( ++nLin, 001, "NOMBRE DIRECCION CIUDAD ESTADO CEP SALARIO" )
oPrn:Say( ++nLin, 001, Repl("-", 130) )
endif
//--- Corpo do relatorio
//
nlin+=1
oPrn:Say( nLin, 001, Alltrim( first ) + " " + Alltrim( last ) )
oPrn:Say( nLin, 043, street )
oPrn:Say( nLin, 075, left( city, 20) )
oPrn:Say( nLin, 098, state )
oPrn:Say( nLin, 107, zip )
oPrn:Say( nLin, 119, Transform( salary, "@R 999,999,999.99" ) )
**oPrn:Say( nLin, 135, notes )
skip
nItens++
nTotal+= salary
if nLin+1 > oPrn:nMaxLine // se passou a linha max
oPrn:Say( ++nLin, 001, Repl("-", 160) )
nLin:= 1 // volta contador para 1
endif // nova pagina
enddo
oPrn:Say( ++nLin, 001, Repl("-", 160) )
oPrn:Say( ++nLin, 001, "Total de Funcionarios : " + Alltrim( Tran( nItens,"999,999" ) ) )
oPrn:Say( nLin, 119, Transform( nTotal, "@R 999,999,999.99" ) )
oPrn:EndPage() // salta pagina
oPrn:End()
end sequence
close TEST2
//--- Passar a Dialog como ultimo parametro.
//
if oPrn:lPreview
TxtPreview( oPrn:cDevice, cTitulo, lModal,,, oPrn, oDlg, , oPrn:lModoGraf )
endif
endif
return nil
*------------------------------------------*
Function ActivePrnType()
*------------------------------------------*
// Function created by Anser
// This function will check whether the current/active/selected printer is
// Dot Matrix or InkJet/Laser
// Return Value .T. = Dot MAtrix
// Return Value .F. = Inkjet or Laser
Local oPrn
PRINT oPrn NAME "Test"
if Empty( oPrn:hDC )
MsgStop("No printers Installed")
Return .F. // Printer is not installed or ready
endif
IF oPrn:nLogPixelX() <= 350 // Dot Matrix Printer ie Text Printer
ENDPRINT
Return .T.
else // Injet or Laser ie Grpahics Printer
ENDPRINT
Return .F.
Endif
ENDPRINT
Return .F.
*----------------------------------------*
FUNCTION IsNetworkPrn(cPrnName)
*----------------------------------------*
* Function created by Anser
* This function will determine whether the Printer is a Network Printer(DOT Matrix)
* cPrnName is the Name of the Printer For Eg.PrnGetName()-> \\Abhi\Epson LQ-2080 ESC/2 P
Local cPrnPcName:=""
Local aPrnSrvrs:={},nPos:=0
aPrnSrvrs:=oWinGetSerP() // Gives NetBios name of PrintServers availabe to the user
cPrnName:=Ltrim(Rtrim(cPrnName))
if left(cPrnName,2) == "\\"
cPrnName:=Right(cPrnName,len(cPrnName)-2) // Remove the \\ from the Printer name found at the begining of the Prn name
cPrnPcName:=LEFT(cPrnName, AT("\",cPrnName) -1) // Pick only the PCName ie Abhi from the string "Abhi\Epson LQ-2080"
else
Return .F.
Endif
nPos:=aScan(aPrnSrvrs,cPrnPcName)
if nPos > 0
Return .T.
Else
Return .F.
Endif
*----------------------------------------------*
FUNCTION PrnPortUrl(cPrnName)
*----------------------------------------------*
* Fuction created by Anser
* Returns a string \\NetBiosName_Of_The_Pc_Where_The_Printer_IsPhysically_Installed\Printer_ShareName
* Expected value in Parameter cPrnName is the Printer Name For Eg.PrnGetName()-> "\\Abhi\Epson LQ-2080 ESC/2 P"
* Uses Registry to find out the values
LOCAL cRealPrnName:="", cPcName :="" , cPrnShareName:="" , cRegPath:=""
LOCAL oReg
if empty(cPrnName)
MsgStop("Printer Name is empty. Unable to proceed further")
Return ""
Endif
cPrnName:=Ltrim(Rtrim(cPrnName))
if left(cPrnName,2) == "\\" // Network Dot Matrix Printer name will have \\ in the beginning of the Printer Name
cPrnName:=Right(cPrnName,len(cPrnName)-2) // Remove the \\ from the Printer name found at the begining of the Prn name
cPcName:=LEFT(cPrnName, AT("\",cPrnName) -1) // Pick the PCName ie Abhi from the string "Abhi\Epson LQ-2080"
cRealPrnName:=RIGHT(cPrnName, Len(cPrnName)-AT("\",cPrnName) ) // Picking the Printer name after avoiding the "\\Abhi\" from the string
Endif
// Path in the registry for Windows 2000 and above
cRegPath:="SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\"+cPcName+"\Printers\"+cRealPrnName+"\DsSpooler"
oReg := TReg32():New(HKEY_LOCAL_MACHINE,cRegPath )
IF oReg:nError = 0
cPcName := oReg:Get("shortServerName", "")
cPrnShareName := oReg:Get("printShareName", "")
else
MsgInfo("Unable to locate NetBiosName of the PC where the Printer is physically installed"+CRLF+;
"Unable to locate the Printer's ShareName")
Return ""
ENDIF
oReg:Close()
oReg := NIL
RETURN "\\"+cPcName+"\"+cPrnShareName
*******************
FUNCTION oWinGetSerP()
*******************
* Returns the names of print servers available for the current post
* Author Badara Thiam
LOCAL nHandle
LOCAL cValue
LOCAL n1
LOCAL n2
LOCAL cSubkeys
LOCAL aHKey := HKEY_LOCAL_MACHINE
LOCAL TSERVEURS := {}
cSubKeys := "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers"
IF RegOpenKey( aHKey, cSubKeys, @nHandle ) == 0
* Recherche des serveurs accessibles
n1 := 0
TSERVEURS := {}
DO WHILE .T.
cValue := ""
n2 := RegEnumKey( nHandle, n1, @cvalue )
SysRefresh()
IF n2 = 0
AADD(TSERVEURS, cValue)
ELSE
EXIT
ENDIF
n1 ++
ENDDO
RegCloseKey( nHandle )
ENDIF
RETURN ACLONE(TSERVEURS)
i hope that you can help me
thanks
fwh 17.12, harbour 3.2.0, pelles C, bcc7, Ms-Sql
Re: TdosPrn con Preview e impresoras laser
Your code is working fine for me. I was able to preview and then print to a network Laser printer.artu01 wrote:you can try my code with your program and tell me if you get to print over usb printer
i hope that you can help me
Anyway, I am herewith giving you the download link of the prg, make file, exe etc.
https://rapidshare.com/files/1904692306/Atur.zip
Regards
Anser