Help for xbrowse report bSetUp

Post Reply
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Help for xbrowse report bSetUp

Post by Silvio.Falconi »

I have to use a particular bsetup for my printouts

when I compile it does not accept the line that I put in bold how can I fix it?

bSetUp := < |oRep, Brw, n |
bImage := {|oRep| oRep:SayBitmap(0.5, 7, cLogo)}
bStart := {|oRep| oRep:bStartPage := bImage}
bInit := {|| oBrw:oDbf:GoTop()}
bSkip := {|| (IF(!oBrw:oDbf:Eof(),oBrw:oDbf:Skip(),nil),IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.f.,oRep:lShadow :=.t.))}
if n == 2
oRep:oShdBrush := TBrush():New(,nRgb(219,229,241))
oRep:bInit := bInit
oRep:bSkip := bSkip
oRep:bStartPage := bImage
oRep:CellView()
oRep:Shadow()
return nil
endif
return 2
>
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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Help for xbrowse report bSetUp

Post by Silvio.Falconi »

If I change with this :

Code: Select all | Expand

 bSetUp   := < |oRep, Brw, n |
   bImage := {|oRep| oRep:SayBitmap(0.5, 7, cLogo)}
   bStart := {|oRep| oRep:bStartPage := bImage}
   bInit := {|| oBrw:oDbf:GoTop()}
   
   if n == 2
            oRep:SetShdColor( nRgb(219,229,241) )
            AEval( oRep:aColumns, { |o| o:lshadow:=.t.   } )

       oRep:bInit := bInit
       oRep:bStartPage := bImage

       oRep:bSkip := {|oRep|  IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.f.,oRep:lShadow :=.t.) }
    
       oRep:Shadow(1)
      return nil
      endif
      return 2
      >

I have this result

Image

any solution?
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
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Help for xbrowse report bSetUp

Post by cmsoft »

Silvio:
En el metodo Report de Xbrowse, oRep:bSkip lo sobreescribe con esto:

Code: Select all | Expand

if Len( ::aSelected ) > If( ::lMultiSelect, 1, 0 )
       Eval( ::bBookMark, ::aSelected[ 1 ] )
       nRows        := Len( ::aSelected )
       nSel         := 1
       oRep:bSkip   := { || nSel++, Eval( oBrw:bBookMark, oBrw:aSelected[ min( nSel, nRows ) ] ) }
   else
      Eval( ::bGoTop, Self )
      nRows           := Eval( ::bKeyCount )
      oRep:bSkip   := { |n| lEof := ( Eval( oBrw:bSkip, n ) != n ) }

   endif
 
Por eso es que la linea
oRep:bSkip := {|oRep| IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.f.,oRep:lShadow :=.t.) }
No tiene efecto
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Help for xbrowse report bSetUp

Post by Silvio.Falconi »

cmsoft wrote:Silvio:
En el metodo Report de Xbrowse, oRep:bSkip lo sobreescribe con esto:

Code: Select all | Expand

if Len( ::aSelected ) > If( ::lMultiSelect, 1, 0 )
       Eval( ::bBookMark, ::aSelected[ 1 ] )
       nRows        := Len( ::aSelected )
       nSel         := 1
       oRep:bSkip   := { || nSel++, Eval( oBrw:bBookMark, oBrw:aSelected[ min( nSel, nRows ) ] ) }
   else
      Eval( ::bGoTop, Self )
      nRows           := Eval( ::bKeyCount )
      oRep:bSkip   := { |n| lEof := ( Eval( oBrw:bSkip, n ) != n ) }

   endif
 
Por eso es que la linea
oRep:bSkip := {|oRep| IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.f.,oRep:lShadow :=.t.) }
No tiene efecto
the bskip it make right because I made

If empty(aColumns)
aColsReport:= oBrw:aCols
else
aColsReport := aColumns
Endif

oBrw:Report( cTitle, .t., .t.,bSetUp , , , aColsReport )


and the report behaves the same check both selected and unselected columns, selected and unselected rows
the problem is in the printing of the pajama effect which gives an error



give me error not fund ncounter

Code: Select all | Expand

 AEval( oRep:aColumns, { |o,oRep| IF(oRep:nCounter % 2 =1 , o:lshadow:=.t.,o:lshadow:=.f.)  } )

If made

Code: Select all | Expand

  AEval( oRep:aColumns, { |o| o:lshadow:=.t.   } ) 
oRep:Shadow(1)
 
select some rows

Image

select some cols

Image

it print all with shadow

Image


I tried also with

Code: Select all | Expand

AEval( oRep:aColumns, { |o| o:lShadow := ! o:lShadow   } )
not run ok

I wish the pajama effect
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