SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby joseluisysturiz » Fri Sep 08, 2017 3:23 am

Regards, I have an old system in dbf, this contains an xbrowse with a logical field column to use setcheck (), was working fine the setcheck (), for reasons I made some changes in a report and I had to recompile with fwh 17.5 and now although I do change the logical field of .t .->. f. / .f .->. t., but now I do not change the image of the setcheck no matter how I use it ... some idea of what to check.? annex xBrowse code and function where I make the change in the DBF, greetings, thanks ... :shock:

DEFINITION OF XBROWSE
Code: Select all  Expand view  RUN

   oBrw:=TxBrowse():New( oDlgPpal )

   WITH OBJECT oBrw
      :nMarqueeStyle := MARQSTYLE_HIGHLCELL
      :nColDividerStyle := LINESTYLE_BLACK
      :nStretchCol := STRETCHCOL_LAST
      :lColDividerComplete := .t.
      :lAllowColSwapping := .f.
      :lAllowColHiding := .f.
      :nHeaderHeight := 20
      :l2007 := .t.
      :lFooter := .t.
      :lRecordSelector := .t.
      :lFastEdit := .t.
      :bLDblClick := {|| tildafactu( oDbfFACTU, oBrw ) } // DOBLE CLICK
   END WITH

//COMIENZAN LAS COLUMNAS
*** COL.1
   oCol := oBrw:AddCol()
   oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:fecha, SPACE(10) ) }
   oCol:cHeader       := "Fecha"
   oCol:nWidth        := 70
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_CENTER

*** COL.2
   oCol := oBrw:AddCol()
   oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:factura, SPACE(10) ) }
   oCol:cHeader       := "No.FACT."
   oCol:nWidth        := 80
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_CENTER

*** COL.3
   oCol := oBrw:AddCol()
   oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:control, SPACE(10) ) }
   oCol:cHeader       := "No.CTRL"
   oCol:nWidth        := 80
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_CENTER
   oCol:nEditType     := EDIT_GET
   oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
   oCol:bOnPostEdit   := { | oCol, xVal, nKey | If( nKey == VK_RETURN .or. ;
                                                   nKey == VK_DOWN ,;
                                                   ( oDbfFACTU:control := xVal ,;
                                                   oDbfFACTU:SAVE() ), ) }

*** COL.4
   oCol := oBrw:AddCol()
   oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:nombre, SPACE(250) ) }
   oCol:cHeader       := "NOMBRE O RAZON SOCIAL DEL CLIENTE"
   oCol:nWidth        := 250
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_LEFT

*** COL.5
   oCol := oBrw:AddCol()
   oCol:bStrData := {|| IIF( LastRec() > 0, oDbfFACTU:rif, SPACE(10) ) }
   oCol:cHeader  := "RIF"
   oCol:cFooter  := "TOTALES --->"
   oCol:nFootStrAlign := AL_RIGHT
   oCol:nWidth        := 80
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_LEFT

*** COL.6 - MTO.BASE
   oCol := oBrw:AddCol()
   oCol:bEditValue := {|| oDbfFACTU:subtotal }
   oCol:cEditPicture := "@E 999,999,999.99"
   oCol:cHeader       := "MTO.BASE"
   oCol:nWidth        := 70
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_RIGHT
   oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
   oCol:nEditType     := EDIT_GET
   oCol:lTotal        := .t.      // PARA TOTALIZAR
   oCol:nTotal        := 0        // PARA TOTALIZAR
   oCol:nFooterType   := AGGR_SUM // PARA TOTALIZAR
   oCol:nFootStrAlign := AL_RIGHT // PARA TOTALIZAR

*** COL.7 - MTO.IVA
   oCol := oBrw:AddCol()
   oCol:bEditValue := {|| oDbfFACTU:total-oDbfFACTU:subtotal }
   oCol:cEditPicture := "@E 999,999,999.99"
   oCol:cHeader       := "MTO.IVA"
   oCol:nWidth        := 70
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_RIGHT
   oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
   oCol:nEditType     := EDIT_GET
   oCol:lTotal        := .t.
   oCol:nTotal        := 0
   oCol:nFooterType   := AGGR_SUM
   oCol:nFootStrAlign := AL_RIGHT

*** COL.8 - MTO.NETO
   oCol := oBrw:AddCol()
   oCol:bEditValue := {|| oDbfFACTU:total }
   oCol:cEditPicture := "@E 999,999,999.99"
   oCol:cHeader       := "MTO.NETO"
   oCol:nWidth        := 70
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_RIGHT
   oCol:nEditType     := EDIT_GET
   oCol:lTotal        := .t.
   oCol:nTotal        := 0
   oCol:nFooterType   := AGGR_SUM
   oCol:nFootStrAlign := AL_RIGHT
   oCol:bOnChange := { || oBrw:MakeTotals() ,;
                          oBrw:RefreshFooters() } // ACT.TOT.EN LOS FOOTERS(13/01/2013)
   oCol:bEditWhen := {|| oDbfFACTU:marca == .f. } // NO EDITA SI ESTA MARCADO PARA RETENCION
   oCol:bOnPostEdit   := { | oCol, xVal, nKey | If( nKey == VK_RETURN ,;
                           ( oDbfFACTU:total := xVal ,; // MTO.NETO
                           oDbfFACTU:subtotal := oDbfFACTU:total/1.12 ,; // MTO.BRUTO
                           oDbfFACTU:mtoiva := oDbfFACTU:total - oDbfFACTU:subtotal ,; // MTO.IVA
                           oDbfFACTU:SAVE() ), ) }

*** COL.9 - MARCA(check)
   oCol := oBrw:AddCol()
   oCol:cHeader       := "Sel"
   oCol:bEditValue      := {|| IIF( LastRec() == 0, .f. ,;
                                 oDbfFACTU:marca ) }
   oCol:nHeadStrAlign := AL_CENTER
   oCol:nDataStrAlign := AL_CENTER
   oCol:nWidth        := 20
   oCol:cToolTip      := "Doble Click/ENTER/ESPACIO para marcar/descargar."
   oCol:SetCheck()
*   oCol:SetCheck( { "OK16", .t. } )
//
   oBrw:SetoDbf( oDbfFACTU )
   oBrw:CreateFromResource( 100 )
   oBrw:MakeTotals()
   oBrw:REFRESH()
 



FUNCTION true / false / true
Code: Select all  Expand view  RUN

PROCEDURE tildafactu( oDbf, oBrw )

   IF oDbf:LastRec() > 0
      IF oDbf:marca == .f.
         oDbf:marca := .t.
      ELSE
         oDbf:marca := .f.
      ENDIF
   ENDIF

   oDbf:SAVE()
   
   oBrw:GOTOP()

   oBrw:REFRESH()
   oBrw:MakeTotals()

RETURN
 
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby nageswaragunupudi » Fri Sep 08, 2017 8:45 am

Please use COLUMNS syntax to construct XBrowse. If not, you will miss many features of XBrowse.

Example:
Code: Select all  Expand view  RUN
FWNumFotmat( "E", .T. )

REDEFINE XBROWSE oBrw ID 100 OF oDlgPpal ;
   DATASOURCE oDbfFactu ;
   COLUMNS "Fetcha", "FACTURA", "CONTROL", "NOMBRE", "RIF", "SUBTOTAL", "TOTAL-SUBTOTAL", "TOTAL", "MARCA" ;
   HEADERS nil, "No.FACT","No.CTRL", "NOMBRE O RAZON SOCIAL DEL CLIENTE", "RIF", "MTO.BASE", "MTO.IVA", "MTO.NETO", "SEL" ;
   CELL LINES NOBORDER FOOTERS FASTEDIT
   
oBrw:nEditTypes      := EDIT_GET
oBrw:aCols[ 7 ]:nEditType := 0

for n := 6 to 8
   oBrw:aCols[ n ]:nFooterType := AGGR_SUM
next

oBrw:aCols[ 9 ]:SetCheck()

oBrw:MakeTotals()

ACTIVATE DIALOG oDlg CENTERED
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby joseluisysturiz » Sat Sep 09, 2017 4:01 am

nageswaragunupudi wrote:Please use COLUMNS syntax to construct XBrowse. If not, you will miss many features of XBrowse.

Example:
Code: Select all  Expand view  RUN
FWNumFotmat( "E", .T. )

REDEFINE XBROWSE oBrw ID 100 OF oDlgPpal ;
   DATASOURCE oDbfFactu ;
   COLUMNS "Fetcha", "FACTURA", "CONTROL", "NOMBRE", "RIF", "SUBTOTAL", "TOTAL-SUBTOTAL", "TOTAL", "MARCA" ;
   HEADERS nil, "No.FACT","No.CTRL", "NOMBRE O RAZON SOCIAL DEL CLIENTE", "RIF", "MTO.BASE", "MTO.IVA", "MTO.NETO", "SEL" ;
   CELL LINES NOBORDER FOOTERS FASTEDIT
   
oBrw:nEditTypes      := EDIT_GET
oBrw:aCols[ 7 ]:nEditType := 0

for n := 6 to 8
   oBrw:aCols[ n ]:nFooterType := AGGR_SUM
next

oBrw:aCols[ 9 ]:SetCheck()

oBrw:MakeTotals()

ACTIVATE DIALOG oDlg CENTERED
 



Mr. NAGE, as always as successful, as it is an old application, I did not want to touch anything, since the only change I made was in a Fast Report report, but when compiling with FWH 17, I see that I must change the xBrowse, nor way, your suggestion worked as before, greetings ... thanks ... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby nageswaragunupudi » Sat Sep 09, 2017 4:08 am

You need to change the syntax if and only if you want to use any new features of xbrowse.
Old code also works, but only to the extent of display of the browse without any new features of the xbrowse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby joseluisysturiz » Sat Sep 09, 2017 6:48 am

nageswaragunupudi wrote:You need to change the syntax if and only if you want to use any new features of xbrowse.
Old code also works, but only to the extent of display of the browse without any new features of the xbrowse.


I understand what you are saying, but I did not make any changes to the xbrowse, just change a data in the fast report print file and when compiling that change, the xbrowse setcheck of another unprotected .prg file stopped working , I assume I should continue working as I did before ... something that did not happen ... now I must modify the xbrowse to the way you suggest me to re-operate my code correctly that I have not made change in any option of xbrowse , greetings thank you... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: SetCheck WITH DBF DOES NOT CHANGE IMAGE TRUE / FALSE

Postby nageswaragunupudi » Sat Sep 09, 2017 7:10 am

As I sad, SetCheck() does not work with the way you coded.
You can continue your old code and it works the same way now also, but do not try to add any new features
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests