Effect Pjama on Treport ( from Xbrowse)

Effect Pjama on Treport ( from Xbrowse)

Postby Silvio.Falconi » Mon May 08, 2023 7:16 am

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 view
oBrw:Report( cTitle, , , ;
         { |oRep, oBrw| MySetUp( oRep, oBrw, oDbf,aGroup,nGroup,lEject,aCampi ) } )


I tried to insert this line

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

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
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: Effect Pjama on Treport ( from Xbrowse)

Postby karinha » Mon May 08, 2023 11:45 am

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: Effect Pjama on Treport ( from Xbrowse)

Postby Silvio.Falconi » Tue May 09, 2023 8:28 am

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

Re: Effect Pjama on Treport ( from Xbrowse)

Postby mauri.menabue » Wed May 10, 2023 9:50 pm

hi Silvio
try this
Code: Select all  Expand view



      ::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
mauri.menabue
 
Posts: 146
Joined: Thu Apr 17, 2008 2:38 pm

Re: Effect Pjama on Treport ( from Xbrowse)

Postby Silvio.Falconi » Thu May 11, 2023 6:22 am

mauri.menabue wrote:hi Silvio
try this
Code: Select all  Expand view



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

Re: Effect Pjama on Treport ( from Xbrowse)

Postby Silvio.Falconi » Thu May 11, 2023 6:22 am

mauri.menabue wrote:hi Silvio
try this
Code: Select all  Expand view



      ::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 view
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 view

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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests