group on oBrw:Report

group on oBrw:Report

Postby Silvio.Falconi » Tue May 02, 2023 8:36 am

I would like to group in the report but it doesn't work for me

through a combobox the user selects the index

oDbf:setorder(nGroup)
oDbf:gotop()

nGroup is a number

aGroup := {nGroup}

oBrw:Report( cTitle, , , ;
{ |oRep, oBrw| MySetUp( oRep, oBrw, oDbf ) }, aGroup )

Code: Select all  Expand view
static function MySetUp( oRep, oBrw, oDbf )
   local  cFooter  := "footer title"
   local  cTitle1  := "title row 1"
   local  cTitle2  := "title row 2"
   local cLines   := cValToChar( oBrw:nLen ) + " lines"


   DEFINE FONT oFont NAME 'tahoma' SIZE 0,-9 OF oRep:oDevice

    oRep:aFont[ 1 ]   := oFont

    oRep:nTitleUpLine := RPT_SINGLELINE
    oRep:nTitleDnLine := RPT_SINGLELINE
    oRep:nTotalLine   := RPT_SINGLELINE

    oRep:oheader := TrLine():New( {{||cTitle1},{||cTitle2} }, oRep, 0 )
    oRep:oTitle := TrLine():New( {{|| cf(date())+"- Pagina  : "+Str(oRep:nPage,3)} }, oRep, 2 )

    AEval( oRep:aColumns, { | o | o:lShadow := ! o:lShadow } )
    oRep:bskip := { || IF(oRep:nCounter % 2 =0 , oRep:lShadow :=.F.,oRep:lShadow :=.T.) }

   
      return  nil

 


I also want to eject the page and make pijama effect but not work
Code: Select all  Expand view
AEval( oRep:aColumns, { | o | o:lShadow := ! o:lShadow } )
    oRep:bskip := { || IF(oRep:nCounter % 2 =0 , oRep:lShadow :=.F.,oRep:lShadow :=.T.) }



on report give me this

Image

it looks like it does the group but then it doesn't, it looks like it's not indexed but actually i index the odbf file but maybe not the oBrw it gets the data from


I tried to add on MySetUp() function also these lines but not work

Code: Select all  Expand view


local cAlias   := oBrw:cAlias
 IF   len(aGroup) > 0
     //group
      IF lEject
           GROUP ON "(cAlias)->"+ltrim(aGroup[nGroup]) ;
           HEADER aGroup[nGroup]+" :"+"(cAlias)->"+aGroup[nGroup] ;
           FOOTER space(40)+"Total items "+oRep:aGroups[1]:cValue+ ;
                  " ("+ltrim(str(oRep:aGroups[1]:nCounter))+")" ;
           FONT 1   EJECT
        else
           GROUP ON "(cAlias)->"+ltrim(aGroup[nGroup]) ;
           HEADER aGroup[nGroup]+" :"+"(cAlias)->"+aGroup[nGroup] ;
           FOOTER space(40)+"Total items "+oRep:aGroups[1]:cValue+ ;
                  " ("+ltrim(str(oRep:aGroups[1]:nCounter))+")" ;
           FONT 1
         Endif
   Endif
 


How resolve it ?
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: group on oBrw:Report

Postby Silvio.Falconi » Wed May 03, 2023 9:09 pm

Any solution please?
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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests