Page 1 of 1

txbrowse totals and edit modes

Posted: Wed Feb 16, 2022 8:11 am
by Detlef
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: Select all | Expand


   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

Re: txbrowse totals and edit modes

Posted: Wed Feb 16, 2022 8:58 pm
by Detlef
For a better description i put this screenshot here:

Image

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

Re: txbrowse totals and edit modes

Posted: Wed Feb 16, 2022 11:16 pm
by cmsoft
Hola!
Cambia

Code: Select all | Expand

:aCols[ 5 ]:nFooterType  := AGGR_TOTAL
por

Code: Select all | Expand

:aCols[ 5 ]:nFooterType  := AGGR_SUM
y prueba
Y a la columna 5 define que es editable

Code: Select all | Expand

:aCols[5]:nEditType := EDIT_GET

Re: txbrowse totals and edit modes

Posted: Thu Feb 17, 2022 11:38 am
by nageswaragunupudi

Code: Select all | Expand

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

 

Re: txbrowse totals and edit modes

Posted: Thu Feb 17, 2022 3:32 pm
by Detlef
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

Re: txbrowse totals and edit modes

Posted: Thu Feb 17, 2022 4:42 pm
by nageswaragunupudi
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.

Re: txbrowse totals and edit modes

Posted: Thu Feb 17, 2022 7:39 pm
by Detlef
Many thanks, Mr. Rao.
I'll follow your recommendations.