![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|
|
#1
|
|||
|
|||
|
Impresion directa
Perdon me equivoquede rutina pra enviar a excel los datos del query. Aqui t va la rutina para impresion directa
procedure TFpto_pollo.imprime_fac(stdoc, stipo:shortstring;sndoc:integer); Var MyPrinter: TextFile; xcan, xdes, xval, xtot, xpag, xcam:shortstring; xsum:real; begin AssignFILE(MyPrinter,'LPT1'); ReWrite(MyPrinter); Write(MyPrinter, CHR(27) + CHR(64)); // Inicializar Impresora //Write(MyPrinter, CHR(27)+CHR(67)+CHR(44)); // Fijar Tamaño en Lineas Write(MyPrinter,CHR(27)+ CHR(103)); // Tipo de Letra Chicas //Write(MyPrinter,CHR(27)+CHR(197)); // Negrita //Write(MyPrinter,CHR(27)+CHR(179)+CHR(28)); // Espacio entre Lines if stipo='FAC' then Writeln(MyPrinter,'MICROMARKET VIA RAPIDA') else Writeln(MyPrinter,'POLLOS ROSS'); if stipo='FAC' then Writeln(MyPrinter,'AV.ROQUE AGUILERA ESQ.RADIAL CASTILLA') else Writeln(MyPrinter,'AV.SANTOS DUMONT CASI 4TO ANILLO'); if stipo='FAC' then Writeln(MyPrinter,'NIT 2642735017 TELF.3513621') else Writeln(MyPrinter,'NO ES FACTURA TELF.3533417'); if stipo='FAC' then Writeln(MyPrinter,'FACTURA : '+wnrofac.text+' ALFAB.'+walfab.text); if stipo='FAC' then Writeln(MyPrinter,'NR.ORDEN:'+wnorden.text+' FECHA:'+datetostr(now)); if wnomfac.Text<>'' then Writeln(MyPrinter,'Senores : '+wnomfac.text) else Writeln(MyPrinter,'Senores : Clientes Varios'); //---------------------------- if wnit.Text<>'' then Writeln(MyPrinter,'NIT : '+wnit.text) else Writeln(MyPrinter,'PARA SERVIRSE EN :'+tbl_gloprod.fieldbyname('refer').asstring); //------------------------------ tbl_gloprod.Locate('tdoc;ndoc',VarArrayOf([stdoc,sndoc]),[loCaseinsensitive]); //loCaseInsensitive Writeln(MyPrinter,'-------------------------------------'); Writeln(MyPrinter,' Cant. Producto Valor '); Writeln(MyPrinter,'-------------------------------------'); xsum:=0; tbl_movpro.Locate('tdoc;ndoc',VarArrayOf([stdoc,sndoc]),[loCaseinsensitive]); //loCaseInsensitive while not tbl_movpro.Eof and (tbl_movpro.FieldByName('tdoc').AsString=stdoc) and (tbl_movpro.FieldByName('ndoc').AsInteger=sndoc) do begin xcan:=format('%6.2f',[tbl_movpro.fieldbyname('cant').asfloat]); xdes:=copy(tbl_movpro.fieldbyname('descri').AsString,1,20); xval:=format('%8.2f',[tbl_movpro.fieldbyname('valor_bs').asfloat]); xsum:=xsum+tbl_movpro.fieldbyname('valor_bs').asfloat; Writeln(MyPrinter,xcan+' '+xdes+' '+xval); tbl_movpro.Next; end; Writeln(MyPrinter,'-------------------------------------'); xtot:=format('%8.2f',[xsum]); xpag:=format('%8.2f',[strtofloat(wpagbs.text)]); xcam:=format('%8.2f',[strtofloat(wcamb.text)]); Writeln(MyPrinter,' Total Facturado : '+xtot); Writeln(MyPrinter,' Total Pagado : '+xpag); Writeln(MyPrinter,' Cambio : '+xcam); Writeln(MyPrinter,'-------------------------------------'); if stipo='FAC' then Writeln(MyPrinter,'MICROMARKET VIA RAPIDA LE AGRADECE') else Writeln(MyPrinter,'POLLOS ROSS LE AGRADECE'); Writeln(MyPrinter,'POR SU PREFERENCIA '+stdoc+'-'+inttostr(sndoc)); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); Writeln(MyPrinter,''); //Write(MyPrinter,#12); // Expulsar la Hoja System.CloseFile(MyPrinter); end; Y funciona re bien |
|
#2
|
||||
|
||||
|
ya gracias
No te preocupes por la equivocacion, voya ver tambien el procedimiento de envio a excel a ver como me va, aunque aun no lo he necesitado pero no se sabe cuando se requiera....
![]() ![]() ![]() ![]() ![]() ![]() ![]() gracia a todos
__________________
tu mente es tu mas presiado tesoro, cultiva tu conocimiento |
|
#3
|
|||
|
|||
|
Cita:
pero por esas casualidades para colocarlo en las cordenadas X e Y como se hace??? me dijeron que es con el modo grafico de la impresora pero no logro dar con la tecla |
|
#4
|
|||
|
|||
|
hmmmmm
y si quisiera que el detalle te salga ordenado ...es decir
cant. Descripcion Precio 1 Producto1 12.00 2 Producto2 15.00 se puede ??, el codigo anterior funciona perfecto peor el ordden del detalle no es estetico. Me quiero volver changos hasta en el mensaje me salio desordenado el reporte ![]() Última edición por nelostanley fecha: 19-09-2008 a las 16:13:46. |
|
#5
|
|||
|
|||
|
Orden de los productos
si puedes hacerlo. basta que le des el orden en la base de datos.
por ejm. si estas usando SQL server, puedes crear un campo de correlatividad en base al cual te imprima el listado. |
|
#6
|
|||
|
|||
|
Cita:
Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney |
|
#7
|
|||
|
|||
|
Cita:
Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Ayunda con impresión directa | jcheco | Impresión | 2 | 25-08-2006 11:57:31 |
| Impresion Directa | berna | Impresión | 3 | 07-04-2005 17:29:22 |
| impresion directa a impresora | e_god | Impresión | 2 | 12-01-2005 20:14:43 |
| Impresión directa en puerto COM | altp | Impresión | 10 | 22-05-2004 17:26:03 |
| Impresión directa en EPSON | guillotmarc | Impresión | 6 | 03-09-2003 10:50:00 |
|