assuming you have an A4 format sheet
how can I calculate the last useful line to print ( with tprinter class) information like timestamp or page number?
I try with
@ 28, 0 PRINT TO oPrn TEXT TimeStamp() ;
SIZE 6.90, 0.8 CM ALIGN "TL" FONT oFnt COLOR CLR_BLACK
but not print any
last useful line in a sheet
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
last useful line in a sheet
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
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
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: last useful line in a sheet
Mira se ayuda:
Mira se ayuda:
Regards, saludos.
Mira se ayuda:
Code: Select all | Expand
// c:\fwh..\samples\SILSTAMP.PRG
#include "FiveWin.ch"
#define PAD_LEFT 0
#define PAD_RIGHT 1
#define PAD_CENTER 2
static oWnd
MEMVAR nCopias
FUNCTION Main()
nCopias := 1 // ponga en el dialogo Number of copies.
DEFINE WINDOW oWnd FROM 1, 1 TO 20, 60 TITLE "Printing a Window"
@ 3, 3 BUTTON "&Print me" OF oWnd SIZE 80, 20 ;
ACTION PrintMe_Copias() // try also with oWnd:HardCopy()
@ 5, 3 BUTTON "&End" OF oWnd SIZE 80, 20 ;
ACTION ( oWnd:End() )
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
FUNCTION PrintMe_Copias()
LOCAL nI
FOR nI := 1 TO nCopias
SYSREFRESH()
PrintMe()
NEXT
RETURN NIL
FUNCTION PrintMe()
LOCAL oPrn, oFont, oPen, aPrn, nLinha, nColuna, ResLinha, ResColuna
LOCAL cData := Date(), cText
aPrn := GetPrinters()
IF Empty( aPrn ) // Empty( oPrn:hDC )
MsgStop ("No se encontró impresora", "No se encontró impresora")
RETURN NIL
ENDIF
PRINTER oPrn PREVIEW MODAL // PARA TESTAR A IMPRESSORA ANTES DE IMPRIMIR
IF EMPTY( oPrn:hDC )
MsgInfo ("HABÍA ALGO MAL CON LA IMPRESORA", "ENCIENDA LA IMPRESORA")
oPrn:End()
RETURN( .F. )
ENDIF
oPrn:End()
cText := TimeZone( cData ) // EL TEXTO para el preview.
PRINT oPrn PREVIEW MODAL
DEFINE FONT oFont NAME "Arial" SIZE 0, -30 BOLD OF oPrn
DEFINE PEN oPen WIDTH 2 OF oPrn
oPrn:SetPage(9)
oPrn:SetPortrait()
ResLinha := oPrn:nLogPixely()/2.54
ResColuna := oPrn:nLogPixelx()/2.54
nLinha := 01
nColuna := 10
PAGE
@ 15, 01 PRINT TO oPrn TEXT cText SIZE 19,3 CM FONT oFont COLOR CLR_RED
@ 19, 05 PRINT TO oPrn TEXT cText SIZE 19,3 CM ALIGN "TL" FONT oFont COLOR CLR_BLACK
oPrn:Say( nLinha * ResLinha, 7.25 * ResColuna, ;
"TimeZone: " + TimeZone( cData ), oFont,, CLR_BLACK,, PAD_CENTER )
ENDPAGE
ENDPRINT
oFont:End()
RETURN NIL
FUNCTION TimeZone( dData )
Local cDateTimeZone,aTimeStamp,cTzd
Default dData:=Date()
aTimeStamp := hb_atokens(tip_timestamp(dData)," ")
cTzd:=aTail(aTimeStamp)
cTzd:=Left(cTzd,Len(cTzd)-2)+":"+Right(cTzd,2)
cDateTimeZone:=StrZero(Year(dData),4)+"-"+StrZero(Month(dData),2)+"-"+StrZero(Day(dData),2)+"T"+Time()+cTzd
Return( cDateTimeZone )
// fin / end
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: last useful line in a sheet
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oPrn, oFont
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "VERDANA" SIZE 0,-12 OF oPrn
PAGE
@ 1,1 PRINT TO oPrn TEXT HB_DateTime() ;
SIZE oPrn:PageWidth( "INCHES" ) - 1.5, ;
oPrn:PageHeight( "INCHES" ) - 1.5 ;
INCHES ;
ALIGN "BR" FONT oFont
ENDPAGE
ENDPRINT
RELEASE FONT oFont
return nil
![Image](https://imagizer.imageshack.com/v2/xq70/922/inmM9s.png)
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: last useful line in a sheet
nageswaragunupudi wrote:Code: Select all | Expand
#include "fivewin.ch" function Main() local oPrn, oFont PRINT oPrn PREVIEW DEFINE FONT oFont NAME "VERDANA" SIZE 0,-12 OF oPrn PAGE @ 1,1 PRINT TO oPrn TEXT HB_DateTime() ; SIZE oPrn:PageWidth( "INCHES" ) - 1.5, ; oPrn:PageHeight( "INCHES" ) - 1.5 ; INCHES ; ALIGN "BR" FONT oFont ENDPAGE ENDPRINT RELEASE FONT oFont return nil
Nages,
run ok
as you can see here
![Image](https://i.postimg.cc/XJ7PfNJs/k.png)
How could I calculate any page numbers and page total?
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
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
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: last useful line in a sheet
Silvio.Falconi wrote:nageswaragunupudi wrote:Code: Select all | Expand
#include "fivewin.ch" function Main() local oPrn, oFont PRINT oPrn PREVIEW DEFINE FONT oFont NAME "VERDANA" SIZE 0,-12 OF oPrn PAGE @ 1,1 PRINT TO oPrn TEXT HB_DateTime() ; SIZE oPrn:PageWidth( "INCHES" ) - 1.5, ; oPrn:PageHeight( "INCHES" ) - 1.5 ; INCHES ; ALIGN "BR" FONT oFont ENDPAGE ENDPRINT RELEASE FONT oFont return nil
Nages,
run ok
as you can see here
![Image](https://i.postimg.cc/XJ7PfNJs/k.png)
How could I calculate any page numbers and page total?
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
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