FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour txbrowse totals and edit modes
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
txbrowse totals and edit modes
Posted: Wed Feb 16, 2022 08:11 AM
Hi all.
Perhaps some FW users remember me.
My former name was Detlef Hoefner. After marriage my name has changed.
I am already retiree and reactivated my FWH version 10.2 with hobby purpose.

My problem is a txBrowse which doesn't show column totals and neither accepts edited values.
I can edit values but whe i leave the cells the former content remains visible.

Here my code :
Code (fw): Select all Collapse
   REDEFINE XBROWSE oBrwPos ID 50 OF oDlg ALIAS "pos" FOOTERS COLOR CLR_INK, CLR_PAPER FASTEDIT LINES
      oBrwPos:AddColumn( " Datum ",     {|| pos->datum    },                , , , "CENTER", 86, .F., .F.,  .t., , , , , .F., , , , , .F., , , )
      oBrwPos:AddColumn( " Leistung ",  {|| pos->leistung },                , , , "LEFT",  430, .F., .F.,  .t., , , , , .F., , , , , .F., , , )
      oBrwPos:AddColumn( " Anzahl ",    {|| pos->dauer    }, "999"          , , , "RIGH",   63, .F., .F.,  .t., , , , , .F., , , , , .F., , , )
      oBrwPos:AddColumn( " Einheit ",   {|| pos->einheit  },                , , , "CENTER", 70, .F., .F.,  .t., , , , , .F., , , , , .F., , , )
      oBrwPos:AddColumn( " Summe ",     {|| pos->summe    }, "@E 99,999.99" , , , "RIGHT",  92, .F., .F.,  .t., , , , , .F., , , , , .F., , , )
      oBrwPos:AddColumn( " MwSt-Satz ", {|| pos->mwstsatz }, "@E 99.99"     , , , "RIGHT",  66, .F., .F.,  .t., , , , , .F., , , , , .F., , , )

   WITH OBJECT oBrwPos
      :nMarqueeStyle    := MARQSTYLE_HIGHLROW
      :nRowDividerStyle := 1
      :nColDividerStyle := 3
      :lHScroll         := .f.
      :nDataLines       := 1
      :lFastEdit        := .f.
      :nStretchCol      := STRETCHCOL_LAST
      :bClrSel          := {|| { CLR_BLACK, CLR_NO_FOCUS } }
      :MakeTotals()

      :aCols[ 1 ]:nEditType    := EDIT_DATE

      :aCols[ 2 ]:nEditType    := EDIT_GET_LISTBOX
      :aCols[ 2 ]:aEditListBound   := ;
      :aCols[ 2 ]:aEditListTxt := aPosCfg[ 1 ]

      :aCols[ 4 ]:nEditType    := EDIT_GET_LISTBOX
      :aCols[ 4 ]:aEditListTxt := { "Std.", "Min.", "km", "UE" }

      :aCols[ 5 ]:nFooterType  := AGGR_TOTAL
      :aCols[ 5 ]:cEditPicture := '@ €99,999.99'
   END


I'd be glad for any help.
Detlef
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: txbrowse totals and edit modes
Posted: Wed Feb 16, 2022 08:58 PM
For a better description i put this screenshot here:



I think that my problem is not a fault of my FWHX Version.
I believe it's caused by my missing FW-practice for over eight years :-)

Therefore i appreciate any advice
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: txbrowse totals and edit modes
Posted: Wed Feb 16, 2022 11:16 PM
Hola!
Cambia
Code (fw): Select all Collapse
 :aCols[ 5 ]:nFooterType  := AGGR_TOTAL
por
Code (fw): Select all Collapse
 :aCols[ 5 ]:nFooterType  := AGGR_SUM
y prueba
Y a la columna 5 define que es editable
Code (fw): Select all Collapse
:aCols[5]:nEditType := EDIT_GET
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: txbrowse totals and edit modes
Posted: Thu Feb 17, 2022 11:38 AM
Code (fw): Select all Collapse
FWNumFormat( "E", "," )

REDEFINE XBROWSE oBrwPos ID 50 OF oDlg ;
   ALIAS "pos" FOOTERS COLOR CLR_INK, CLR_PAPER FASTEDIT CELL LINES;
   COLUMNS "Datum", "Leistung". "dauer", "Einheit","Summe","mwstsatz" ;
   HEADERS nil, nil, "Anzahl", nil, nil, "MwSt-Satz"

  WITH OBJECT oBrwPos
      //:nMarqueeStyle    := MARQSTYLE_HIGHLROW
      :nRowDividerStyle := 1
      :nColDividerStyle := 3
      :lHScroll         := .f.
      :nDataLines       := 1
      :lFastEdit        := .f.
      :nStretchCol      := STRETCHCOL_LAST
      :bClrSel          := {|| { CLR_BLACK, CLR_NO_FOCUS } }
      // :MakeTotals()  // NOT HERE

      :aCols[ 1 ]:nEditType    := EDIT_DATE

      :aCols[ 2 ]:nEditType    := EDIT_GET_LISTBOX
      :aCols[ 2 ]:aEditListBound   := ;
      :aCols[ 2 ]:aEditListTxt := aPosCfg[ 1 ]

      :aCols[ 4 ]:nEditType    := EDIT_GET_LISTBOX
      :aCols[ 4 ]:aEditListTxt := { "Std.", "Min.", "km", "UE" }

      :aCols[ 5 ]:nFooterType  := AGGR_TOTAL
      :aCols[ 5 ]:nEditType    := EDIT_GET
      :aCols[ 5 ]:cEditPicture := '@ €99,999.99'
   
      :MakeTotals() // Now xbrowse knows which columns to total
END
Regards



G. N. Rao.

Hyderabad, India
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: txbrowse totals and edit modes
Posted: Thu Feb 17, 2022 03:32 PM

Many thanks to Cesar and Mr. Rao.
Your advices look very helpful.
I'll give them a try when I’m back home on Sunday.

Does anyone still have a clue why selected items from the browse selectboxes are not written into the dbf fields?
Thanks again

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: txbrowse totals and edit modes
Posted: Thu Feb 17, 2022 04:42 PM
Does anyone still have a clue why selected items from the browse selectboxes are not written into the dbf fields?

We know very well.
The codebocks you have used in AddColumn() methods are readonly. They can not be used to assign values.

That is the reason We (FWH Team) recommends use of COLUMNS clause. In that case, xbrowse itself internally generate the correct codeblocks.

Please implement our recommendation (this is official recommendation of FWH) using COLUMNS clause as shown in my previous post.
Regards



G. N. Rao.

Hyderabad, India
Posts: 218
Joined: Mon Feb 07, 2022 09:54 PM
Re: txbrowse totals and edit modes
Posted: Thu Feb 17, 2022 07:39 PM

Many thanks, Mr. Rao.
I'll follow your recommendations.

Continue the discussion