print lines

print lines

Postby Silvio.Falconi » Mon Nov 21, 2016 11:12 am

I need to print dotted lines but I not remember how I can make it with oprn object no report
an help please

I use
oPenTratt := TPen():New(PS_DOT, 1, CLR_HGRAY, oPrn )
oPrn:Line(aDes[1],aDes[2],aHas[1],aHas[2],oPenTratt)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: print lines

Postby karinha » Mon Nov 21, 2016 12:41 pm

Maybe:

Code: Select all  Expand view

 #include "Fivewin.ch"
 #include "Report.ch"
 #include "FileIo.ch"


 #define    VERSION        "Versión 1.2 <14-01-2011> (Rev. 00.13)"
 #define    K_ENTER        13
 #define    COMPARTIDO     .T.
 #define    EXCLUSIVO      .F.

 #define    COLBLANCO   255,255,255

 #define        COL_BRTEX   255,255,255
 #define        COL_BRFON       0,75,105

 #define        ID_VTDBF    OemToAnsi(' Facturaci¢n PYME  ')+VERSION+CRLF+;
                            OemToAnsi(' (c) CEPEDA Servicios Inform ticos 2004')

 #define  NL  Chr( 10 ) + Chr( 13 )
 #define  SAF    100

 Static oBar
 Static oWnd
 Static oFont
 Static oIcon
 Static oBrush
 Static cNomEmp
 Static cPathEm
 Static lSelEmp
 Static cNifEmp

 Function Main()

 LOCAL aStruct
 LOCAL lCreado    := .F.
 LOCAL oSay
 LOCAL aFieldsNew := {}
 LOCAL lActivado  := .F.

 SET DATE ITALIAN
 SET DELETED ON
 SET CENTURY ON
 SET EPOCH TO 1960
 SET CONFIRM ON
 SET 3DLOOK ON

 DEFINE FONT oFont NAME "Arial" SIZE 0, -12
 ACTIVATE FONT oFont

 DEFINE ICON oIcon FILENAME "..\icons\fivetech.ICO"

 DEFINE BRUSH oBrush FILENAME "..\bitmaps\backgrnd\sky3.bmp"

 DEFINE WINDOW oWnd MDI FROM 04, 10 TO 30, 90;
        TITLE OemToAnsi( "Facturaci¢n PYME" ) ;
        MENU Menu() ;
        ICON oIcon ;
        BRUSH oBrush
        SET FONT OF oWnd TO oFont
        SET MESSAGE OF oWnd TO ;
        OemToAnsi('Facturaci¢n PYME           Usuario = '+WNetGetUser());
        TIME DATE KEYBOARD 2007

 DEFINE BUTTONBAR oBar _3D SIZE 45, 45 TOP OF oWnd 2007
 DEFINE BUTTON OF oBar FILENAME "..\bitmaps\cascade.bmp"  TOOLTIP ;
 'Facturación' ACTION PintUnaFac( oWnd ) MESSAGE 'Emisión de facturas' GROUP
 DEFINE BUTTON OF oBar FILENAME "..\bitmaps\exit.bmp"      TOOLTIP 'Terminar';
 ACTION oWnd:End() MESSAGE 'Termina el programa' GROUP

 ACTIVATE WINDOW oWnd MAXIMIZED

 Return NIL
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Static Function Menu()

 LOCAL oMenu

 MENU oMenu
   MENUITEM '&Selección' MESSAGE 'Selecci¢n de Empresa'
   MENU
     MENUITEM '&Terminar' ACTION oWnd:End() MESSAGE 'Termina el programa'
   ENDMENU
   MENUITEM '&Ventas'    MESSAGE 'Procesos generales de VENTAS'
   MENU
     MENUITEM '&Facturas' ACTION PintUnaFac( oWnd ) MESSAGE 'Emisión de facturas'
   ENDMENU
 ENDMENU
 Return oMenu

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Static Function PintUnaFac( oWnd )

 LOCAL oDlg, oFont, aoBtn[ 2 ]
 
 DEFINE FONT oFont NAME "Arial" SIZE  0, -12

     DEFINE DIALOG oDlg TITLE "FWH Ver. 7.11 queda el preview detrás";
 FROM 0, 0 TO 380, 350 ; //Alto y Ancho
 PIXEL OF oWnd FONT oFont
 
 @ 164, 72 BUTTON aoBtn[ 1 ] PROMPT "&Imprimir" PIXEL SIZE 35,10 OF oDlg ;
           ACTION Imprimir( oDlg )

 @ 164,130 BUTTON aoBtn[ 2 ] PROMPT "Sa&lir" PIXEL SIZE 35,10 OF oDlg ;
           ACTION oDlg:End()
           
 ACTIVATE DIALOG oDlg CENTER

 Return NIL
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Static Function Imprimir( oWnd )

 LOCAL oPrn, oFont1, oFont2, oFont3, oFont4, oFont5, oFont6, oFont7, oFont8, ;
       oFontLogo, oPen1, oPen2

 LOCAL aCoord1[ 2 ], aCoord2[ 2 ]
 LOCAL nFil, nCol, nTop, nBot
 LOCAL nAnch, nAlto
 LOCAL nPixHorz, nPixVert
 LOCAL nAncho_1, nAncho_2
 
 oWnd:End()

 PRINT oPrn NAME "Impresión de facturas" PREVIEW

 IF Empty( oPrn:hDC )
   MsgStop( OemToAnsi( "¡ No hay IMPRESORA para imprimir !" ))
   Return NIL
 EndIF
 
 nPixVert := oPrn:nVertRes()
 nPixHorz := oPrn:nHorzRes()

 IF nPixHorz < 3000
   nAnch    := 8913290
   nAlto    := 12255652
   nAncho_1 := 4
   nAncho_2 := 7
 ELSE
   nAnch := 8913494
   nAlto := 12256000
   nAncho_1 := 6
   nAncho_2 := 11
 EndIf


 DEFINE FONT oFont1 NAME "Arial" SIZE 0, -6  OF oPrn
 DEFINE FONT oFont2 NAME "Arial" SIZE 0, -9  OF oPrn
 DEFINE FONT oFont3 NAME "Arial" SIZE 0, -12 BOLD OF oPrn
 DEFINE FONT oFont4 NAME "Arial" SIZE 0, -11 OF oPrn
 DEFINE FONT oFont5 NAME "Arial" SIZE 0, -16 OF oPrn
 DEFINE FONT oFont6 NAME "Arial" SIZE 0, -10 OF oPrn
 DEFINE FONT oFont7 NAME "Courier New" SIZE 0, -10 OF oPrn
 DEFINE FONT oFont8 NAME "Times New Roman" SIZE 0, -10 BOLD OF oPrn
 DEFINE FONT oFontLogo NAME "Arial" SIZE 0, -19 BOLD OF oPrn
 DEFINE PEN   oPen1 WIDTH nAncho_1
 DEFINE PEN   oPen2 WIDTH nAncho_2

   PAGE
   // Cabecera
       nFil := 1.6
       nCol := 2.2
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       oPrn:CmSay ( 3.1,  2.3, "PRUEBA DE IMPRESIÓN", oFontLogo )

       nFil :=  4.4
       nCol := 10.9
       nTop :=  7.7
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Box ( nFil, nCol, nTop, nBot, oPen2 )           //Caja Cliente
       oPrn:CmSay ( 4.0, 11.0, 'Dirección Correspondencia del Cliente:', oFont2 )
       oPrn:CmSay ( 4.7, 11.1, "Juan Pérez de las Heras", oFont4 )
       oPrn:CmSay ( 5.2, 11.1, "Compras", oFont4 )
       oPrn:CmSay ( 5.7, 11.1, "La Calle, 22", oFont4 )
       oPrn:CmSay ( 6.7, 11.1, "Madrid", oFont4 )

       nFil :=  8.15
       nCol :=  2.20
       nTop :=  8.75
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Box ( nFil, nCol, nTop, nBot, oPen2 )           //Caja n§ fra. etc
       oPrn:CmSay ( 8.15,  2.30, 'C.I.F.:', oFont3 )
       oPrn:CmSay ( 8.15,  6.00, 'Nº Factura :', oFont3 )
       oPrn:CmSay ( 8.15, 11.20, 'Fecha : ', oFont3 )
       oPrn:CmSay ( 8.15, 15.60, 'F. Pago :', oFont3 )

       nFil :=  8.90
       nCol :=  2.20
       nTop :=  9.50
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Box ( nFil, nCol, nTop, nBot, oPen2 )           //Caja observaciones
       oPrn:CmSay ( 9.10, 2.30, 'Observaciones:', oFont2 )
       nFil :=  9.65
       nCol :=  2.20
       nTop := 23.25
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Box ( nFil, nCol, nTop, nBot, oPen2 )           //Caja cuerpo factura
       nFil :=  9.65
       nCol :=  5.20
       nTop := 23.25
       nBot :=  5.20
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )           //1¦ VERTICAL
       nFil :=  9.65
       nCol := 12.20
       nTop := 23.25
       nBot := 12.20
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )           //2¦ VERTICAL
       nFil :=  9.65
       nCol := 13.80
       nTop := 23.25
       nBot := 13.80
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )           //3¦ VERTICAL
       nFil :=  9.65
       nCol := 15.80
       nTop := 23.25
       nBot := 15.80
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )           //4¦ VERTICAL
       nFil :=  9.65
       nCol := 17.10
       nTop := 23.25
       nBot := 17.10
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )           //5¦ VERTICAL
       nFil := 10.20
       nCol :=  2.20
       nTop := 10.20
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )  // Subrayado HORIZONTAL
       oPrn:CmSay( 9.65,  2.30, 'Código'     , oFont3 )
       oPrn:CmSay( 9.65,  5.30, 'Descripción', oFont3 )
       oPrn:CmSay( 9.65, 12.30, 'Unid.'      , oFont3 )
       oPrn:CmSay( 9.65, 14.00, 'Precio'     , oFont3 )
//     oPrn:CmSay( 9.65, 16.20, 'Dto.'       , oFont3 )
       oPrn:CmSay( 9.65, 18.20, 'Importe'    , oFont3 )

       nFil := 23.40
       nCol :=  2.20
       nTop := 27.20
       nBot := 20.15
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Box ( nFil, nCol, nTop, nBot, oPen2 )           //Caja Final TOTALES

       oPrn:CmSay ( 23.50,   2.40, 'BASE', oFont7 )
       oPrn:CmSay ( 23.50,   5.20, '%IVA', oFont7 )
       oPrn:CmSay ( 23.50,   6.75, 'CUOTA', oFont7 )
       oPrn:CmSay ( 23.50,   9.60, '%RE', oFont7 )
       oPrn:CmSay ( 23.50,  11.20, 'CUOTA', oFont7 )
       oPrn:CmSay ( 23.50,  14.10, 'IMPORTE', oFont7 )

       nFil := 24.00
       nCol :=  2.20
       nTop := 24.00
       nBot := 16.70
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //1¦ HORIZONT TOTALES

       nFil := 23.40
       nCol :=  4.95
       nTop := 26.20
       nBot :=  4.95
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //1¦ VERTICAL TOTALES
       nFil := 23.40
       nCol :=  6.45
       nTop := 26.20
       nBot :=  6.45
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //2¦ VERTICAL TOTALES
       nFil := 23.40
       nCol :=  9.35
       nTop := 26.20
       nBot :=  9.35
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //3¦ VERTICAL TOTALES
       nFil := 23.40
       nCol := 10.95
       nTop := 26.20
       nBot := 10.95
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //4¦ VERTICAL TOTALES
       nFil := 23.40
       nCol := 13.80
       nTop := 26.20
       nBot := 13.80
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen1 )         //5¦ VERTICAL TOTALES
       nFil := 23.40
       nCol := 16.65
       nTop := 26.20
       nBot := 16.65
       aCoord1 := oPrn:Cmtr2Pix( @nFil, @nCol )
       aCoord2 := oPrn:Cmtr2Pix( @nTop, @nBot )
       oPrn:Line ( nFil, nCol, nTop, nBot, oPen2 )         //6¦ VERTICAL TOTALES

       oPrn:CmSay ( 23.50, 16.95, 'SUMA BASES:', oFont6 )
       oPrn:CmSay ( 26.44,  2.40, 'TOTAL IVA:',     oFont6 )
       oPrn:CmSay ( 26.44,  7.70, 'TOTAL R.E.:',    oFont6 )
       oPrn:CmSay ( 26.44, 13.35, 'TOTAL FACTURA:', oFont4 )


   ENDPAGE

 ENDPRINT

 oFont1:End()
 oFont2:End()
 oFont3:End()
 oFont4:End()
 oFont5:End()
 oFont6:End()
 oFont7:End()
 oFont8:End()
 oFontLogo:End()
 oPen1:End()
 oPen2:End()

 Return NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7795
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: print lines

Postby Silvio.Falconi » Mon Nov 21, 2016 1:03 pm

YES OF CORSE

i NEED
----------------------------------------------------------------------------------------------------------------------------------------
AND NOT
________________________________________________________________________________________________

THANKS
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: print lines

Postby Silvio.Falconi » Mon Nov 21, 2016 1:06 pm

PLEASE :

DEFINE PEN oPen1 STYLE PS_DOT WIDTH 1 COLOR CLR_HGRAY // NOT RUN


oPenTratt := TPen():New(PS_DOT, 1, CLR_HGRAY, oPrn ) //RUN
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: print lines

Postby karinha » Mon Nov 21, 2016 1:35 pm

?????

Look, TESTPRN2.PRG


Something type:

Code: Select all  Expand view

 REPLICATE ( "-" ) ?
 


Regards
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7795
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: print lines

Postby nageswaragunupudi » Mon Nov 21, 2016 9:52 pm

You forgot "OF oPrn"
It should be
Code: Select all  Expand view
DEFINE PEN oPen1 STYLE PS_DOT WIDTH 1 COLOR CLR_HGRAY OF oPrn
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: print lines

Postby Silvio.Falconi » Tue Nov 22, 2016 8:07 am

ok now run thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter and 56 guests