In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

SELECCIONAR IMPRESORA

Foro público de Xailer en español
Responder
Paco V
Mensajes: 380
Registrado: Jue Oct 27, 2005 9:08 am

SELECCIONAR IMPRESORA

Mensaje por Paco V »

Como puedo seleccionar la impresora por la que quiero que salga un report
entre las que tengo instaladas.
Tiene que ser distinta que la predeterminada y ese report debera salir siempre
por ella.
Gracias
Paco V
Paco V
Mensajes: 380
Registrado: Jue Oct 27, 2005 9:08 am

SELECCIONAR IMPRESORA

Mensaje por Paco V »

Intentare explicarme mejor.
He visto la propiedad to printer del report. Pero como le digo la impresora?
Paco V
"Paco V" <ssi@ono.com> wrote:
>
>Como puedo seleccionar la impresora por la que quiero que salga un report
>entre las que tengo instaladas.
>Tiene que ser distinta que la predeterminada y ese report debera salir siempre
>por ella.
>
>Gracias
>
>Paco V
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

SELECCIONAR IMPRESORA

Mensaje por jfgimenez »

Paco,
Printer:aPrinterNames contiene la lista de las impresoras instaladas, y con
Printer:nPrinterIndex seleccionas la que quieras usar de ellas. P.ej.: si
pones Printer:nPrinterIndex := 3, significa que se va a utilizar la tercera
impresora de esa lista.
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Paco V
Mensajes: 380
Registrado: Jue Oct 27, 2005 9:08 am

SELECCIONAR IMPRESORA

Mensaje por Paco V »

Jose:
Esto deberia funcionar?
Solo me cambia el tipo de letra.
LOCAL oFrm, oReport, oFont1, oFont2, n, AUX1, AUX2
n:=1
With Object oFont1 := TFont():New()
:cName := "Arial"
:nSize := 14
:lBold := .T.
END WITH
With Object oFont2 := TFont():New()
:cName := "Arial"
:nSize := 8
:lBold := .f.
END WITH
REPORT oReport TITLE "RED", " ****PRUEBA*** "+;
FONT 1; ////PREVIEW
HEADER DtoC( Date() ) + " " + Time(), "del dia :"+;
dtoc(date()-1)+" usuario: "+ APPDATA:NombrOp;
FOOTER "Página: " + lTrim( Str(oReport:nPage ) ) FONT 2;
FONT oFont1, oFont2
Printer:nPrinterIndex := 2
msginfo(Printer:aPrinterNames)

set printer to printer:nprinterindex
AUX1 := DTOC(DATE()-1)
AUX2 := "20"+SUBSTR(AUX1,7,2)+SUBSTR(AUX1,3,4)+SUBSTR(AUX1,1,2)
SET FILTER TO ::OdBFdATASET1:TIPO # "GRAFIADO" .AND. ::oDbfDataset1:fecha
= aux2
::oDBFDataSet1:Gotop()
COLUMN OF oReport ;
TITLE "RESID." ;
DATA SUBSTR(::oDbfDataSet1:Residencia,1,5);
FONT 2
RUN REPORT oReport
"Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote:
>Paco,
>
>Printer:aPrinterNames contiene la lista de las impresoras instaladas, y
con
>Printer:nPrinterIndex seleccionas la que quieras usar de ellas. P.ej.: si
>pones Printer:nPrinterIndex := 3, significa que se va a utilizar la tercera
>impresora de esa lista.
>
>--
>Un saludo,
>
>José F. Giménez
>
>
PACO V[1]
Mensajes: 2
Registrado: Vie Dic 30, 2005 9:40 am

SELECCIONAR IMPRESORA

Mensaje por PACO V[1] »

A ver si lo voy pillando.
Esto es lo que creo que deberia hacer para que funcionara.
Pues selecciona bien, me cambia el tipo de letra, pero al final imprime por
la que tengo predeterminada en WINDOWS.
METHOD ACTIVAIMP( oSender ) CLASS TForm8
LOCAL oFrm, oReport, oFont1, oFont2, n := 1

With Object oFont1 := TFont():New()
:cName := "Arial"
:nSize := 14
:lBold := .T.
END WITH

With Object oFont2 := TFont():New()
:cName := "Arial"
:nSize := 8
:lBold := .f.
END WITH
REPORT oReport TITLE "PRUEBA"FONT 1;
HEADER "Correspondiente a HOY"+" Impreso por el usuario:
"+ APPDATA:NombrOp;
FOOTER "Página: " + lTrim( Str( oReport:nPage ) ) ALIGN
taCENTER ;
FONT 2;
FONT oFont1, oFont2
*************
do while n < len(printer:aPrinterNames)+1
if Printer:aPrinter[n]= "LAQUEQUIERO"
Printer:nPrinterIndex := n
n := 8
else
n:= n+1
endif
enddo
**************
COLUMN OF oReport ;
TITLE "RESID." ;
DATA SUBSTR(::oDbfDataSet1:Residencia,1,5);
FONT 2
COLUMN OF oReport ;
TITLE "Nº VALE" ;
DATA VAL(::oDbfDataSet1:Numero);
FONT 2
RUN REPORT oReport
RETURN Nil
"Paco V" <ssi@ono.com> wrote:
>
>Jose:
>
>Esto deberia funcionar?
>
>Solo me cambia el tipo de letra.
>
>
>LOCAL oFrm, oReport, oFont1, oFont2, n, AUX1, AUX2
> n:=1
> With Object oFont1 := TFont():New()
> :cName := "Arial"
> :nSize := 14
> :lBold := .T.
> END WITH
>
> With Object oFont2 := TFont():New()
> :cName := "Arial"
> :nSize := 8
> :lBold := .f.
> END WITH
>
> REPORT oReport TITLE "RED", " ****PRUEBA*** "+;
>
> FONT 1; ////PREVIEW
> HEADER DtoC( Date() ) + " " + Time(), "del dia :"+;
> dtoc(date()-1)+" usuario: "+ APPDATA:NombrOp;
> FOOTER "Página: " + lTrim( Str(oReport:nPage ) ) FONT 2;
> FONT oFont1, oFont2
> Printer:nPrinterIndex := 2
> msginfo(Printer:aPrinterNames)
>
> set printer to printer:nprinterindex
> AUX1 := DTOC(DATE()-1)
> AUX2 := "20"+SUBSTR(AUX1,7,2)+SUBSTR(AUX1,3,4)+SUBSTR(AUX1,1,2)
> SET FILTER TO ::OdBFdATASET1:TIPO # "GRAFIADO" .AND. ::oDbfDataset1:fecha
>= aux2
> ::oDBFDataSet1:Gotop()
>
> COLUMN OF oReport ;
> TITLE "RESID." ;
> DATA SUBSTR(::oDbfDataSet1:Residencia,1,5);
> FONT 2
>
>RUN REPORT oReport
>
>
>"Jose F. Gimenez" <jfgimenez@wanadoo.es> wrote:
>>Paco,
>>
>>Printer:aPrinterNames contiene la lista de las impresoras instaladas, y
>con
>>Printer:nPrinterIndex seleccionas la que quieras usar de ellas. P.ej.:
si
>
>>pones Printer:nPrinterIndex := 3, significa que se va a utilizar la tercera
>
>>impresora de esa lista.
>>
>>--
>>Un saludo,
>>
>>José F. Giménez
>>
>>
>
Responder