Page 1 of 1

bsetup of Report

Posted: Wed Apr 26, 2023 9:20 am
by Silvio.Falconi
this is the report from oBrw:report()

Image

I would simply like to have simple and not double lines, a test on the left and the date and page number/pages on the right

bSetUp := < |oRep, Brw, n |

if n == 2

oRep:bSkip := {|| (IF(!oDbf:Eof(),oDbf:Skip(),nil),;
IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.f.,oRep:lShadow :=.t.))}


return nil
endif
return 2
>


oBrw:Report("List", nil, nil, bSetup)

these lines give me error
source\Pcomuni.prg(349) Error E0005 Outer codeblock variable 'OREP' is out of reach

Code: Select all | Expand

 oRep:oFooter := TrLine():New( {{|| "Page : "+Str(oRep:nPage,3)} }, oRep, 3 )
oRep:bSkip := {|| (IF(!oDbf:Eof(),oDbf:Skip(),nil), IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.F.,oRep:lShadow :=.T.))}

Re: bsetup of Report

Posted: Wed Apr 26, 2023 10:49 am
by Silvio.Falconi
Image

this last result

but i still have problems
1) the stripes don't have the pajama effect, they are all grey
2) does not recognize "Page : "+Str(oRep:nPage,3)
3) the title line needs to be narrower

oBrw:Report( "Stampa elenco", nil, nil, { | oRep, oBrw, n| RepSetUp( oRep, oBrw, n ) })

Code: Select all | Expand

 
static function RepSetUp( oRep, oBrw, n )
     local  csystem:="xxxxxxxxxxxxxxx"
   local  cnomeazienda1:= "aaaaaaaaa"
   local  cnomeazienda2 := "bbbbbbbb"

    if n == 1   // called first time
            oRep:nTitleUpLine := RPT_SINGLELINE
           oRep:nTitleDnLine := RPT_SINGLELINE
           oRep:nTotalLine   := RPT_SINGLELINE
          oRep:nPage      := 0
          oRep:SetShdColor( RGB(243,243,238) )
          oRep:nCounter:= 0
         oRep:CellView()
         oRep:oheader := TrLine():New( {{||cnomeazienda1},{||cnomeazienda2} }, oRep, 0 )
* oRep:oTitle := TrLine():New( {{|oRep|cf(date())+"Page : "+Str(oRep:nPage,3)} }, oRep, 2 )
        oRep:oTitle := TrLine():New( {{|oRep|cf(date())+"- Pagina : "} }, oRep, 2 )
       oRep:ofooter := TrLine():New( {{||" "},{|| "Progetto Magazzino"} }, oRep, 1 )

      return 2   // by returning 2, we are asking for a second call

   else   // called second time after report columns are created

      AEval( oRep:aColumns, { | o | o:lShadow := ! o:lShadow } )
          oRep:bSkip := {|oRep| (IF(!oDbf:Eof(),oDbf:Skip(),nil), IF(oRep:nCounter % 2 =1 , oRep:lShadow :=.F.,oRep:lShadow :=.T.))}


   endif

return nil