Silvio, you use TPrinter.
Look into xBrowse class. There you see that xBrowse class uses printer class.
xbrowse.prg
METHOD Report( cTitle, lPreview, lModal, bSetUp, aGroupBy, cPDF ) CLASS TXBrowse
local oRep, oPrn, oFont, oBold, uRet
local aCols, nFor, oCol, uBookMark
local oBrw := Self
local lAddCols := .T.
local nRows, nSel, n
local lEof := .f.
local lSetUpTwice := .f.
local nLevels
DEFAULT cTitle := If( ::oWnd:ClassName == 'TPANEL', ::oWnd:oWnd:cTitle, ::oWnd:cTitle )
DEFAULT lPreview := .T.
DEFAULT lModal := .T.
if ::nLen < 1 .or. Empty( ::GetVisibleCols )
return nil
endif
oPrn := PrintBegin( cTitle, ; // document
.f., ; // luser
lPreview, nil, ; // xmodel
lModal, ;
.f., ; // lselect
cPDF ) // PDF to Save
Here you see that function PrintBegin comes from printer.prg.
function PrintBegin( cDoc, lUser, lPreview, xModel, lModal, lSelection, cFile )
local cText, aPrn, nScan
if xModel == nil
return oPrinter := TPrinter():New( cDoc, lUser, lPreview,, lModal, lSelection, cFile )
endif
cText = StrTran( GetProfString( "Devices" ), Chr( 0 ), Chr( 13 ) + Chr( 10 ) )
aPrn = Array( MlCount( cText, 250 ) )
AEval( aPrn, { | v, n | aPrn[ n ] := Trim( MemoLine( cText, 250, n ) ) } )
if Valtype( xModel ) == "N"
if xModel < 0 .or. xModel > Len( aPrn )
nScan = 0
else
nScan = xModel
endif
else
if ( nScan := Ascan( aPrn, { | v | Upper( xModel ) == Upper( v ) } ) ) == 0
nScan = Ascan( aPrn, { | v | Upper( xModel ) $ Upper( v ) } )
endif
endif
if nScan == 0
MsgBeep()
return oPrinter := TPrinter():New( cDoc, .T., lPreview,, lModal, lSelection, cFile )
endif
return oPrinter := TPrinter():New( cDoc, .f., lPreview, aPrn[ nScan ], lModal,;
lSelection, cFile )
//----------------------------------------------------------------------------//
Myworkaround is does the job but you first has to setup for the printer model the orientation.
From my notes:
Best regards,
Otto
