set Report Orientation

set Report Orientation

Postby Silvio.Falconi » Sun Jan 02, 2022 10:05 pm

.
Last edited by Silvio.Falconi on Mon Feb 06, 2023 8:51 am, edited 1 time in 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
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby karinha » Mon Jan 03, 2022 1:09 am

Maybe:

Code: Select all  Expand view

// \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
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: set Report Orientation

Postby Silvio.Falconi » Mon Jan 03, 2022 5:34 am

PERHAPS YOU NOT READ THE QUESTION.
I make

oBrw:Report( 'Stampa elenco ', , , ;
{ |oRep, oBrw | MySetUp( oRep, oBrw, lLandscape ) } )

I know how make the orientation if i must use the prg you wrote, but I call report() from oBrw directly
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Silvio.Falconi » Tue Jan 04, 2022 12:21 am

If I make
local lLandscape :=.t.
...
DEFINE DIALOG oDlgStampa

@ 14,70 CHECKBOX oGetland VAR lLandscape PROMPT "Stampa in Orizzontale";
SIZE 120,26 of oDlgStampa

ACTIVATE DIALOG oDlgStampa CENTER


IF oDlgStampa:nresult == IDOK
?llandscape //here is .t.

bSetUp := {|oRep, oBrw, n, llandscape| MyRepSetup( oRep, oBrw, n,llandscape )}
oBrw:Report("Elenco Categorie",.T.,,bSetUp )

Endif


function MyRepSetup( oRep, oBrw, n ,llandscape)

?llandscape //here is nil

if llandscape
oRep:lAutoLand := .T.
else
oRep:lAutoLand := .f.
Endif

oRep:CellView()
oRep:oFooter := TrLine():New( {{|| "Page : "+Str(oRep:nPage,3)} }, oRep, 3 )

return nil
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Otto » Tue Jan 04, 2022 8:56 am

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Silvio.Falconi » Fri Jan 07, 2022 7:42 am



Otto,
I use a xbrowse and call report class from it, no prn
bSetUp := {|oRep, oBrw, n, llandscape| MyRepSetup( oRep, oBrw, n,llandscape )}
oBrw:Report("Elenco Categorie",.T.,,bSetUp )
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Otto » Fri Jan 07, 2022 7:53 am

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Silvio.Falconi » Fri Jan 07, 2022 8:02 am

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


sorry U are usinf printer class instead report class
i know how it must be done with the printer class, but in this context i am calling a report from an xbrowse class, maybe you didn't understand the problem
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Otto » Fri Jan 07, 2022 10:03 am

Silvio, you use TPrinter.
Look into xBrowse class. There you see that xBrowse class uses printer class.
xbrowse.prg
Code: Select all  Expand view

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.

Code: Select all  Expand view


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
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Otto » Fri Jan 07, 2022 10:26 am

Silvio, here you see | i zi pi zi| handling orientation.
Best regards,
Otto


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Silvio.Falconi » Fri Jan 07, 2022 10:35 am

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
Last edited by Silvio.Falconi on Fri Jan 07, 2022 10:51 am, edited 1 time in 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
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Otto » Fri Jan 07, 2022 10:50 am

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



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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Silvio.Falconi » Fri Jan 07, 2022 10:53 am

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



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


I'm not interested

I asked for a specific thing

I don't think it can't be done

I know that in fwh you can do many things that you don't even imagine, but unfortunately I can't publish them and I keep them to myself because if I publish them they are the end of many things I have published
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: set Report Orientation

Postby Otto » Fri Jan 07, 2022 12:32 pm

Silvio,
currently there is no solution available in Fivewin.

If you find a solution, please post it here to help others.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: set Report Orientation

Postby Massimo Linossi » Fri Jan 07, 2022 6:46 pm

Very kind, as always.

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
User avatar
Massimo Linossi
 
Posts: 495
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 91 guests