Page 1 of 1

Help for xbrowse report bSetUp

Posted: Sat Mar 18, 2023 10:14 pm
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
>

Re: Help for xbrowse report bSetUp

Posted: Sat Mar 18, 2023 10:19 pm
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?

Re: Help for xbrowse report bSetUp

Posted: Sun Mar 19, 2023 3:56 am
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

Re: Help for xbrowse report bSetUp

Posted: Sun Mar 19, 2023 9:59 am
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