Need Help With xBrowse (Resolved)

Need Help With xBrowse (Resolved)

Postby RiazKhan » Sat Apr 04, 2020 1:34 pm

I am not very familiar with xBrowse, but I am trying to build this table for the user to modify browsed data. I a linear table format.

REDEFINE XBROWSE oBrw ID 1113 OF oDlg ;
HEADERS aHead[1] ;
FIELDSIZES aFSize[1] ;
PICTURE aPict[1] ;
JUSTIFY aJust[1] ;
FONT oFntX7A ;
ALIAS cAlias ;
FASTEDIT ;
LINES ;
CELL ;
FOOTERS ;
AUTOCOLS ;
AUTOSORT

oBrw:l2007 := .T.
oBrw:nRowHeight := 20
oBrw:nColDividerStyle := 3 //LINESTYLE_BLACK
oBrw:nRowDividerStyle := 3 //LINESTYLE_BLACK
oBrw:lColDividerComplete := .T.
oBrw:lHScroll := .T.
oBrw:lVScroll := .T.
oBrw:lAllowColSwapping := .T.
oBrw:nFreeze := 2
oBrw:lFastEdit := .T.

AEval( oBrw:aCols, { |o| o:nHeadStrAlign := AL_CENTER } )
oBrw:bPopUp := { |o| ColMenu( o ) }
AEval( oBrw:aCols, { |o| o:cToolTip := { o:cHeader, 'ToolTip' } } )

oBrw:bRClicked := { | r,c,f,tBrw | xBrowse( tBrw ) }

oBrw:aCols[ 3 ]:bLClickFooter := { |r,c,f,o| FooterAggrClick( r, c, f, o ) }
oBrw:aCols[ 3 ]:cEditPicture := "99"
oBrw:aCols[ 3 ]:nEditType := EDIT_GET
oBrw:bEditBlock := {|| W_253G( W_253->(RecNo()),3) }

Problem is when the user modifies the column [3] [Days] data, the other fields [A1/A5/Gross] same row must be updated via calling a function [W_253G()] and the totals at bottom of sheet to be updated as well.

Guidance is required to recalculate other columns and update/refresh columns.

Thnx...
Image
Last edited by RiazKhan on Sun Apr 05, 2020 12:22 pm, edited 1 time in total.
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
 
Posts: 99
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Postby leandro » Sat Apr 04, 2020 2:17 pm

Una idea
Code: Select all  Expand view


.......
.......
.......


    oCol          = oBrwRtrc:AddCol()
    oCol:bStrData := {|| if(Len( aRecibo ) > 0 , aRecibo[oBrwRtrc:nArrayAt]["base"] ,0 ) }
    oCol:cHeader  = "Base"
    oCol:nWidth   = 100
    oCol:nHeadStrAlign = AL_RIGHT
    oCol:nDataStrAlign = AL_RIGHT   
    oCol:oHeaderFont = oFont
    oCol:nEditType = EDIT_GET
    oCol:bOnPostEdit   = { | oCol, xVal, nKey | If( nKey == VK_RETURN, calcReteReci(xVal,1),) }
    oCol:bEditValue  = {|| if(Len( aRecibo ) > 0 , aRecibo[oBrwRtrc:nArrayAt]["base"] ,0 ) }
    oCol:bEditValid   = { | oGet | validaRtReci(oGet,oBrwRtrc:nArrayAt) }
    oCol:nFootStrAlign = 1


.......
.......
.......


function calcReteReci(xVal,nCol)
Local nPorce := 0
Local nFactor := 0
Local nBase := 0
Local nValor := 0

if aRecibo[oBrwRtrc:nArrayAt]["codigo"] != "abon"
    if nCol=1
        nBase := aRecibo[oBrwRtrc:nArrayAt]["base"] := xVal
        nPorce := aRecibo[oBrwRtrc:nArrayAt]["porcentaje"]
    else
        nBase := aRecibo[oBrwRtrc:nArrayAt]["base"]
        nPorce := aRecibo[oBrwRtrc:nArrayAt]["porcentaje"] := xVal
    endif
    nFactor := aRecibo[oBrwRtrc:nArrayAt]["factor"]
    nValor := ( nBase * nPorce ) / nFactor
    aRecibo[oBrwRtrc:nArrayAt]["valor"] := round(nValor,0)
else
    aRecibo[oBrwRtrc:nArrayAt]["base"] := ""
    aRecibo[oBrwRtrc:nArrayAt]["porcentaje"] := ""
endif
oBrwRtrc:refresh()
oDlgNtItem:update()
Return nil

 
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Need Help With xBrowse

Postby RiazKhan » Sun Apr 05, 2020 8:38 am

Thanks, Leandro
This did not work.
With the days input by the user all the other columns of the selected row are to be re-formulated.
Refreshed and columns totals to be updated.
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
 
Posts: 99
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Postby RiazKhan » Sun Apr 05, 2020 9:09 am

Hi,
I would appreciate it if someone knows what I am missing in my code.
Probably something very easy, just not coming to me.
Thanks in advance for any help
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
 
Posts: 99
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Postby nageswaragunupudi » Sun Apr 05, 2020 12:17 pm

Please wait Mr. Riaz.
Are you using FWH16.08?
Regards

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

Re: Need Help With xBrowse

Postby RiazKhan » Sun Apr 05, 2020 12:21 pm

Dear Nageswaragunupudi

Thanks, I have resolved my issue.

oBrw:Gross:VarPut( oBrw:Basic:Value + oBrw:A1:Value + oBrw:A5:Value )
oBrw:Net:VarPut( oBrw:Gross:Value + oBrw:ATot:Value - (oBrw:DTot:Value))

VarPut , hmmm slipped my mind, Very simple
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
 
Posts: 99
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Postby nageswaragunupudi » Sun Apr 05, 2020 12:29 pm

RiazKhan wrote:Dear Nageswaragunupudi

Thanks, I have resolved my issue.

oBrw:Gross:VarPut( oBrw:Basic:Value + oBrw:A1:Value + oBrw:A5:Value )
oBrw:Net:VarPut( oBrw:Gross:Value + oBrw:ATot:Value - (oBrw:DTot:Value))

VarPut , hmmm slipped my mind, Very simple


Great !!!
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
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 79 guests

cron