txbrowse totals and edit modes

txbrowse totals and edit modes

Postby Detlef » Wed Feb 16, 2022 8: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: Select all  Expand view  RUN

   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
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: txbrowse totals and edit modes

Postby Detlef » Wed Feb 16, 2022 8:58 pm

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
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: txbrowse totals and edit modes

Postby cmsoft » Wed Feb 16, 2022 11:16 pm

Hola!
Cambia
Code: Select all  Expand view  RUN
:aCols[ 5 ]:nFooterType  := AGGR_TOTAL
por
Code: Select all  Expand view  RUN
:aCols[ 5 ]:nFooterType  := AGGR_SUM
y prueba
Y a la columna 5 define que es editable
Code: Select all  Expand view  RUN
:aCols[5]:nEditType := EDIT_GET
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: txbrowse totals and edit modes

Postby nageswaragunupudi » Thu Feb 17, 2022 11:38 am

Code: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: txbrowse totals and edit modes

Postby Detlef » Thu Feb 17, 2022 3: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
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm

Re: txbrowse totals and edit modes

Postby nageswaragunupudi » Thu Feb 17, 2022 4: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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: txbrowse totals and edit modes

Postby Detlef » Thu Feb 17, 2022 7:39 pm

Many thanks, Mr. Rao.
I'll follow your recommendations.
User avatar
Detlef
 
Posts: 209
Joined: Mon Feb 07, 2022 9:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares and 100 guests