Need Help With xBrowse (Resolved)

Post Reply
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Need Help With xBrowse (Resolved)

Post by RiazKhan »

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
leandro
Posts: 958
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia
Contact:

Re: Need Help With xBrowse

Post by leandro »

Una idea

Code: Select all


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


    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 ALFONSO
SISTEMAS LYMA - BASE
Bogotá (Colombia)
[ FWH 19.09 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20190613) ] [ Embarcadero C++ 7.30 for Win32 ]
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Post by RiazKhan »

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: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Post by RiazKhan »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Need Help With xBrowse

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: Need Help With xBrowse

Post by RiazKhan »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Need Help With xBrowse

Post by nageswaragunupudi »

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
Post Reply