☎ +34 976 234 144

Truco Fox: configurar las copias por programa

FoxPress n.º 141 · julio-agosto de 2006 · Por la Redacción de FoxPress

Artículo publicado en la revista FoxPress en julio-agosto de 2006. Algunos datos, versiones y funciones citados (MySQL, PHP, Visual FoxPro, Windows) pueden haber quedado desfasados.

Puedes programaticamente cambiar la configuración de la impresora para usar el campo Expr en la cabecera del informe del FRX. A diferencia de Tag y Tag2, Expr se guarda en un formato legible.

DRIVER=winspool
 DEVICE=MS Publisher Imagesetter
 OUTPUT=FILE:
 ORIENTATION=0
 PAPERSIZE=1
 SCALE=100
 ASCII=100
 COPIES=1
 DEFAULTSOURCE=15
 PRINTQUALITY=600
 COLOR=1
 YRESOLUTION=600
 TTOPTION=2
 COLLATE=1

Ejemplo para poner programaticamente el número de copias a 2:

* USE MyFrx.frx
USE bar.frx
* find the header record (normally the first one, but who knows)
Locate for ObjType = 1 and ObjCode = 53
* make an array out of the settings in the expr field
lnSettings = ALines( laSettings, expr )
* Find the COPIES element
lnCopiesLine = Ascan( laSettings, "COPIES",1,0,0,4)
* Change it to COPIES = X
laSettings( lnCopiesLine ) = "COPIES = " + Transform( 2 )

* Build a new Expr string out of the array
lcExpr = ""
For lnSetting = 1 to lnSettings
    lcExpr = lcExpr + laSettings( lnSetting ) + Chr(13)
EndFor

* store the new Expr
Replace Expr with lcExpr
* close the table
use
* now run the report

¿Quieres llevar la IA a los datos de tu empresa?

En una auditoría gratuita de 30 minutos vemos qué caso concreto te ahorraría más trabajo.

Reservar mi auditoría →