Effect Pjama on Treport ( from Xbrowse)

Post Reply
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Effect Pjama on Treport ( from Xbrowse)

Post by Silvio.Falconi »

Now I resolve something...

Image

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: Select all | Expand

 oBrw:Report( cTitle, , , ;
         { |oRep, oBrw| MySetUp( oRep, oBrw, oDbf,aGroup,nGroup,lEject,aCampi ) } )
I tried to insert this line

Code: Select all | Expand

 oRep:bStartGroup   :=  { || oRep:TotalLine(RPT_SINGLELINE) }
but this show a line before the header group as you can see with the red arrow

Image

I wish a line where is the blue arrow

then How I can make the effect pijama ?

I tried with

Code: Select all | Expand

 
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 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
karinha
Posts: 7935
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Effect Pjama on Treport ( from Xbrowse)

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Effect Pjama on Treport ( from Xbrowse)

Post by Silvio.Falconi »

karinha wrote:Look this,

https://forums.fivetechsupport.com/view ... 38#p258115

Regards, saludos.
not run!!!
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
mauri.menabue
Posts: 163
Joined: Thu Apr 17, 2008 2:38 pm

Re: Effect Pjama on Treport ( from Xbrowse)

Post by mauri.menabue »

hi Silvio
try this

Code: Select all | Expand



      ::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
User avatar
Silvio.Falconi
Posts: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Effect Pjama on Treport ( from Xbrowse)

Post by Silvio.Falconi »

mauri.menabue wrote:hi Silvio
try this

Code: Select all | Expand



      ::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 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: 7136
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Effect Pjama on Treport ( from Xbrowse)

Post by Silvio.Falconi »

mauri.menabue wrote:hi Silvio
try this

Code: Select all | Expand



      ::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: Select all | Expand

 oColumn := TRColumn():New(aTitle     ,;
                             nCol       ,;
                             aData      ,;
                             nSize      ,;
                             aPicture   ,;
                             uFont      ,;
                             lTotal     ,;
                             bTotalExpr ,;
                             cColFmt    ,;
                            .t.    ,;                                   <----------------------------------(lShadow) 
                             lGrid      ,;
                             nPen       ,;
                             Atail(aReports)[ REPORT ], lCumTotal )
I have this result

Image

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: Select all | Expand

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. )

Image

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 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
Post Reply