Page 1 of 1

Report problem with Tdatabase

PostPosted: Fri Mar 10, 2023 4:18 pm
by Silvio.Falconi
after select the cSigla value

I made on Report class

ACTIVATE REPORT oReport FOR oDbf:PROV == cSigla

why it not run ok ? oDbf:Prov is 2cr as cSigla


Code: Select all  Expand view


Function Report_Comuni(oGrid,oParent,odbf)
   local oRep

   local nRecno   := odbf:Recno()
   local nOrder   := oDbf:OrdSetFocus()

   local oFont3, oFont2, oFont1,oFont4
   local cFooter := "footers"
   local cSigla:="TE"

   oDbf:setorder(3)
   oDbf:GoTop()

     DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
     DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
     DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-10 BOLD ITALIC




   REPORT oRep ;
         TITLE  " ","-","-","Stampa elenco comuni" CENTERED;
         FONT   oFont3, oFont2, oFont1 ;
         HEADER '', oApp():cAppName+oApp():cVersion, oApp():cUser   ;
         FOOTER cFooter, "Data: "+dtoc(date())+ "   Pagina.: "+str(oRep:nPage,3) ;
         CAPTION oApp():cAppName+oApp():cVersion PREVIEW



   COLUMN TITLE "Comune" DATA oDbf:comune
   COLUMN TITLE "Provincia" DATA oDbf:prov



   ENDREPORT

   oRep:bSkip  := { || (oDbf:Skip( 1 )) }
   oRep:cellview()




   ACTIVATE REPORT oRep for oDbf:prov==cSigla;
      ON POSTEND  (oRep:Say(1, 'Totale comuni: '+Tran(oRep:nCounter, '@ 999,999'), 1) )

      oDbf:OrdSetFocus(nOrder)
      oDbf:GoTo(nRecno)

     oFont1:End()
     oFont2:End()
     oFont3:End()

    oGrid:Refresh()
    oGrid:SetFocus( .t. )
  return nil



 

Re: Report problem with Tdatabase

PostPosted: Fri Mar 10, 2023 4:35 pm
by cmsoft
Silvio, tiene que ser igual igual? O sea, diferencia entre mayusculas y minusculas? Y tiene 2 caracteres?
Sino has la prueba con for oDbf:prov=cSigla

Re: Report problem with Tdatabase

PostPosted: Mon Mar 13, 2023 9:24 am
by Silvio.Falconi
Now run only I used a filter with exec comand