FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Effect Pjama on Treport ( from Xbrowse)
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Effect Pjama on Treport ( from Xbrowse)
Posted: Mon May 08, 2023 07:16 AM
Now I resolve something...



I have problem to show the total pages , a black line after each header Group, and make for each record the effect pijama

How I can resolve ?
Code (fw): Select all Collapse
 oBrw:Report( cTitle, , , ;
         { |oRep, oBrw| MySetUp( oRep, oBrw, oDbf,aGroup,nGroup,lEject,aCampi ) } )
I tried to insert this line
Code (fw): Select all Collapse
 oRep:bStartGroup   :=  { || oRep:TotalLine(RPT_SINGLELINE) }
but this show a line before the header group as you can see with the red arrow



I wish a line where is the blue arrow

then How I can make the effect pijama ?

I tried with
Code (fw): Select all Collapse
 
oRep:oShdBrush := TBrush():New(,nRgb(219,229,241))
oRep:bskip := { || IF(oRep:nCounter % 2 =0 , oRep:lShadow :=.F.,oRep:lShadow :=.T.) }
but not run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Effect Pjama on Treport ( from Xbrowse)
Posted: Mon May 08, 2023 11:45 AM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Effect Pjama on Treport ( from Xbrowse)
Posted: Tue May 09, 2023 08:28 AM
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
Re: Effect Pjama on Treport ( from Xbrowse)
Posted: Wed May 10, 2023 09:50 PM
hi Silvio
try this
Code (fw): Select all Collapse
      ::oBrw:Report( ::cTitolo, .T., .T., { |oRep, oBrw| ::ReportGes( oRep, oBrw ) } )


*-----------------------------------------------------------------------------------------------------------------------
METHOD ReportGes( oRep, oBrw )
*-----------------------------------------------------------------------------------------------------------------------

   local oRs    := oBrw:uDataSource
   local cConti := cValToChar( oBrw:nLen ) + " Conti"
   
   COLUMN TITLE "Codice"                DATA ::PrepCnt(oRs:PCO_COD)    SIZE 12                              SHADOW 
   COLUMN TITLE "Tipo"                  DATA oRs:PCO_TIP               SIZE 15                              SHADOW 
   COLUMN TITLE "Denominazione"         DATA oRs:PCO_DEN               SIZE 60                              SHADOW 
   COLUMN TITLE "Classificazione"       DATA oRs:PCO_CLA               SIZE 20                              SHADOW 
   COLUMN TITLE "Progressivo","Dare"    DATA oRs:PCO_DAR               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Progressivo","Avere"   DATA oRs:PCO_AVE               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Saldo","Dare - Avere"  DATA oRs:PCO_DAR - oRs:PCO_AVE SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 

   oRep:oShdBrush  := TBrush():New(,nRgb(219,229,241))
   oRep:bStartLine := { || oRep:lShadow := (oRep:nCounter % 2 != 0)  }    // oReport:bSkip := {|| ( oRs:SKIP(), IF(oRep:nCounter % 2 = 0, oRep:lShadow := .F., oRep:lShadow := .T. ) ) }
   oRep:bPostEnd   := { || oRep:Say( 1, cConti ) }

return .T.
obviously the one shown is a part of the code where there is the call line from the browse and below a method for custom setup.
This should work, you need to set the shadow setting before printing the line using bStartLine instead of bskip
TIA
Maurizio Menabue
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Effect Pjama on Treport ( from Xbrowse)
Posted: Thu May 11, 2023 06:22 AM
mauri.menabue wrote:hi Silvio
try this
Code (fw): Select all Collapse
      ::oBrw:Report( ::cTitolo, .T., .T., { |oRep, oBrw| ::ReportGes( oRep, oBrw ) } )


*-----------------------------------------------------------------------------------------------------------------------
METHOD ReportGes( oRep, oBrw )
*-----------------------------------------------------------------------------------------------------------------------

   local oRs    := oBrw:uDataSource
   local cConti := cValToChar( oBrw:nLen ) + " Conti"
   
   COLUMN TITLE "Codice"                DATA ::PrepCnt(oRs:PCO_COD)    SIZE 12                              SHADOW 
   COLUMN TITLE "Tipo"                  DATA oRs:PCO_TIP               SIZE 15                              SHADOW 
   COLUMN TITLE "Denominazione"         DATA oRs:PCO_DEN               SIZE 60                              SHADOW 
   COLUMN TITLE "Classificazione"       DATA oRs:PCO_CLA               SIZE 20                              SHADOW 
   COLUMN TITLE "Progressivo","Dare"    DATA oRs:PCO_DAR               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Progressivo","Avere"   DATA oRs:PCO_AVE               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Saldo","Dare - Avere"  DATA oRs:PCO_DAR - oRs:PCO_AVE SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 

   oRep:oShdBrush  := TBrush():New(,nRgb(219,229,241))
   oRep:bStartLine := { || oRep:lShadow := (oRep:nCounter % 2 != 0)  }    // oReport:bSkip := {|| ( oRs:SKIP(), IF(oRep:nCounter % 2 = 0, oRep:lShadow := .F., oRep:lShadow := .T. ) ) }
   oRep:bPostEnd   := { || oRep:Say( 1, cConti ) }

return .T.
obviously the one shown is a part of the code where there is the call line from the browse and below a method for custom setup.
This should work, you need to set the shadow setting before printing the line using bStartLine instead of bskip
TIA
Maurizio Menabue
Maurizio,
if a column of the xbrowse has been hidden from the end user?
that's why I have the problem of displaying all columns
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Effect Pjama on Treport ( from Xbrowse)
Posted: Thu May 11, 2023 06:22 AM
mauri.menabue wrote:hi Silvio
try this
Code (fw): Select all Collapse
      ::oBrw:Report( ::cTitolo, .T., .T., { |oRep, oBrw| ::ReportGes( oRep, oBrw ) } )


*-----------------------------------------------------------------------------------------------------------------------
METHOD ReportGes( oRep, oBrw )
*-----------------------------------------------------------------------------------------------------------------------

   local oRs    := oBrw:uDataSource
   local cConti := cValToChar( oBrw:nLen ) + " Conti"
   
   COLUMN TITLE "Codice"                DATA ::PrepCnt(oRs:PCO_COD)    SIZE 12                              SHADOW 
   COLUMN TITLE "Tipo"                  DATA oRs:PCO_TIP               SIZE 15                              SHADOW 
   COLUMN TITLE "Denominazione"         DATA oRs:PCO_DEN               SIZE 60                              SHADOW 
   COLUMN TITLE "Classificazione"       DATA oRs:PCO_CLA               SIZE 20                              SHADOW 
   COLUMN TITLE "Progressivo","Dare"    DATA oRs:PCO_DAR               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Progressivo","Avere"   DATA oRs:PCO_AVE               SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 
   COLUMN TITLE "Saldo","Dare - Avere"  DATA oRs:PCO_DAR - oRs:PCO_AVE SIZE 15 PICTURE "@EZ 999,999,999.99" SHADOW 

   oRep:oShdBrush  := TBrush():New(,nRgb(219,229,241))
   oRep:bStartLine := { || oRep:lShadow := (oRep:nCounter % 2 != 0)  }    // oReport:bSkip := {|| ( oRs:SKIP(), IF(oRep:nCounter % 2 = 0, oRep:lShadow := .F., oRep:lShadow := .T. ) ) }
   oRep:bPostEnd   := { || oRep:Say( 1, cConti ) }

return .T.
obviously the one shown is a part of the code where there is the call line from the browse and below a method for custom setup.
This should work, you need to set the shadow setting before printing the line using bStartLine instead of bskip
TIA
Maurizio Menabue
Maurizio,
if a column of the xbrowse has been hidden from the end user?
that's why I have the problem of displaying all columns
I wanted something generic to be able to use with all xbrows, in fact for groups ( group On) I make the end user select the group in which to index, for example for the customer.dbf archive it could be the State field

IF I modify this command at pdreport.prg
Code (fw): Select all Collapse
 oColumn := TRColumn():New(aTitle     ,;
                             nCol       ,;
                             aData      ,;
                             nSize      ,;
                             aPicture   ,;
                             uFont      ,;
                             lTotal     ,;
                             bTotalExpr ,;
                             cColFmt    ,;
                            .t.    ,;                                   <----------------------------------(lShadow) 
                             lGrid      ,;
                             nPen       ,;
                             Atail(aReports)[ REPORT ], lCumTotal )
I have this result



the problem is that after each report it will be with the pijama effect because one goes to modify that code

Another solution

on xbrowse class there is the function MakeRepCol( oRep, oXCol ) there is the call of RptAddColumn

this function ( RptAddColumn) have the 10th parameter FALSE allways

that's why the pajama effect will never happen


Another solution
on the xbrowse class at Method Report we can add a new parameter
Code (fw): Select all Collapse
METHOD Report( cTitle, lPreview, lModal, bSetUp, aGroupBy, cPDF, aCols, lshadow ) CLASS TXBrowse

  local oRep, oPrn, oFont, oBold, uRet
   local nFor, oCol, uBookMark
   local oBrw := Self
   local lAddCols := .T.
   local nRows, nSel, n
   local lEof     := .f.
   local lSetUpTwice := .f.
   local nLevels
   local nRowSel     := ::nRowSel

   DEFAULT cTitle   := If( ::oWnd:ClassName == 'TPANEL', ::oWnd:oWnd:cTitle, ::oWnd:cTitle )
   DEFAULT lPreview := .T.
   DEFAULT lModal   := .T.
   DEFAULT lShadow  := .F.    // for original compatibility
so you could put this parameter in the function MakeRepCol( oRep, aCols[ nFor ], lShadow )

then add on makeRepcol line 11672

oCol := RptAddColumn( aHeader, nil ,;
{ bData }, nSize, nil ,;
nil, nil, nil ,;
"RIGHT", lShadow, .F., nil, ;
nil, nil, ;
nil, nil, nil, nil, nil, ;
nil, nil, nil, nil, nil, nil, ;
nil, ;
XEval( oxCol:nProgTot , oxCol ), aClr )

and so it might work with

oBrw:Report( cTitle, , , ;
{ |oRep, oBrw| MySetUp( oRep, oBrw, oDbf,aGroup,nGroup,lEject,aCampi ) },, , ,.t. )



but it's just a few ideas, I'm waiting for the solution that Nageswarao will give me
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion