// \samples\RPTLINHA.PRG
#include "FiveWin.ch"
#include "Report.ch"
STATIC oReport, oDlg
FUNCTION Main()
SET CENTURY ON
SET DATE BRITISH
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO Year( Date() ) - 30
USE Customer ALIAS Test
myReport()
RETURN NIL
FUNCTION myReport()
LOCAL oFont1, oFont2, oFont3, oBmp, oPen1, oPen2
LOCAL nfila := -1
LOCAL lLand
DEFINE FONT oFont1 NAME "ARIAL" SIZE 0, - 10
DEFINE FONT oFont2 NAME "ARIAL" SIZE 0, - 10 BOLD
DEFINE FONT oFont3 NAME "ARIAL" SIZE 0, - 10 BOLD ITALIC
DEFINE PEN oPen1 Width 2 COLOR CLR_CYAN
DEFINE PEN oPen2 WIDTH 2 COLOR CLR_GREEN
GO TOP
REPORT oReport ;
TITLE "*** LISTADO DE PRUEBA ***", ;
"", ;
OemtoAnsi( "FiveTech Software" ), ;
"" ;
FONT oFont1, ;
oFont2, ;
oFont3 ;
PEN oPen1, ;
oPen2 ;
HEADER "Fecha: " + DToC( Date() ), ;
"Hora..: " + Time() ;
FOOTER OemtoAnsi( "P gina: " ) + Str( oReport:nPage, 3 ) ;
CENTERED ;
PREVIEW
lLand := IF( oReport:oDevice:GetOrientation() == 1, ( .F. ), ( .T. ) )
oReport:oDevice:lPrvModal := .T.
oReport:oDevice:SetPage( 9 )
IF lLand
MsgInfo( "LANDSCAPE", "Reporte" )
PrnLandScape() // Horizontal
oReport:lAutoLand := .T.
ELSE
MsgInfo( "PORTRAIT", "Reporte" )
PrnPortrait() // Vertical
oReport:lAutoLand := .F.
ENDIF
COLUMN TITLE "Fila" DATA AllTrim( Str( nFila += 0.5 ) )
COLUMN TITLE "ST" ;
DATA Test->STATE ;
FONT 2
COLUMN TITLE "City" ;
DATA Test->City
COLUMN TITLE "First Name", "Last Name" ;
DATA Test->First, Test->Last
COLUMN TITLE " Salary" ;
DATA Test->Salary ;
PICTURE "9,999,999" ;
SIZE 9 ;
TOTAL ;
SHADOW ;
GRID 2
END REPORT
IF .NOT. oReport:lCreated
RETURN NIL
ELSE
oReport:SetTxtColor( CLR_HBLUE, 1 )
oReport:SetTxtColor( CLR_HRED, 2 )
oReport:SetTxtColor( CLR_HBLUE, 3 )
oReport:SetPenColor( CLR_CYAN )
oReport:SetShdColor( CLR_HCYAN )
ENDIF
oReport:CellView()
ACTIVATE REPORT oReport
oFont1:End()
oFont2:End()
oFont3:End()
oPen1:End()
oPen2:End()
RETURN NIL
Otto wrote:Silvio, please look here:
viewtopic.php?f=3&t=40526&p=242094&hilit=orientation&sid=e2593be1086c9bedebb3a003fb838c89#p242094
Best regards,
Otto
Otto wrote:Silvio,
It uses the same source code.
It does not work like that. It is very complicated to change.
It's an open case.
Best regards,
Otto
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
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.
function hochformat()
winexec('RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n "Seminar" /a "c:\setprnter\Seminarhoch.dat"')
return nil
function landscape()
winexec('RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n "Seminar" /a "c:\setprnter\Seminar.dat"')
return nil
Otto wrote:http://forums.fivetechsupport.com/viewtopic.php?f=6&t=40145&p=242740&hilit=orientation&sid=1e156c84b09d5a82f13dda3a84ef6cd1#p242740
Silvio, sorry, there is no solution available at the moment.
I use these workarounds.
Best regards,
Otto
- Code: Select all Expand view RUN
function hochformat()
winexec('RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n "Seminar" /a "c:\setprnter\Seminarhoch.dat"')
return nil
function landscape()
winexec('RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n "Seminar" /a "c:\setprnter\Seminar.dat"')
return nil
Silvio.Falconi wrote:and wich is the command I not understood
oBrw:Report( 'Stampa elenco ', , , ;
{ |oRep, oBrw | MySetUp( oRep, oBrw, lLandscape ) } )
I not want make report with ziziz zipizizi or another bullshit you did when you saw that I was doing something to print
I ask for a specific thing oBrw:report() <<<<<----------------------
and does not care if the xbrowse report method uses Printbegin()
I asked how do you do it?
Now you are all expert professors, You are all good at doing classes, on the other hand, have remained a donkey and have to suffer your bullying
I saw well that the report method uses PrintBegin() did not have to teach me
I asked you how to do it, I didn't ask you to show me how you do all on your zizizpizi
but every time the same story, every time I ask for something to report or print you answer you put this zizizipizi implying to use your zizizpizi,
now enough it bothered me
But do you think I'm enjoying myself asking for help on the forum? or is it working to solve my problems?
I am tailed by you and someone else just hangs up I insert a topic immediately responding with other topics and with incorrect answers
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 54 guests