anserkk wrote:Please check whether you have missed oBrw:SetRDD() in your code.
For eg.
- Code: Select all Expand view
oBrw:SetRDD()
oBrw:MakeTotals()
Regards
Anser
If you have decided not to use the xBrowse via xBrowse command syntax, then please use oCol:cEditPicture instead of Transform(). I have changed your code to use cEditPicture. Inserted the missing oBrw:SetRDD() in your code. The below given code is working fine for me.
- Code: Select all Expand view
Function Main()
Local oDlg,oBrw,aBrowseRb,i
RddSetDefault( "DBFCDX" )
Crea_dbf() //create and popolate dbf
DEFINE DIALOG oDlg TITLE "Testing xBrowse"
@0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oDlg ALIAS "RB";
CELL LINES FOOTERS NOBORDER FASTEDIT
aBrowseRb := { { { || RB->CodArt }, i18n("Codice"), 40, },;
{ { || RB->Articolo}, i18n("Articolo"),140, },;
{ { || RB->Misura}, i18n("Unità"), 50, },;
{ { || RB->Quantita}, i18n("Qt."), 30,'@99999' },;
{ { || RB->Iva}, i18n("Iva"), 30, },;
{ { || RB->Unitario}, i18n("Unitario"), 80,'@ €999,999.99' },;
{ { || RB->Totale}, i18n("Totale"), 90,'@ €999,999.99' } }
FOR i := 1 TO Len(aBrowseRb)
oCol := oBrw:AddCol()
oCol:bEditValue := aBrowseRb[ i, 1 ] // Changed to bEditValue from bStrData
oCol:cHeader := aBrowseRb[ i, 2 ]
oCol:nWidth := aBrowseRb[ i, 3 ]
if !Empty(aBrowseRb[ i, 4 ])
oCol:cEditPicture:=aBrowseRb[ i, 4 ]
Endif
NEXT
WITH OBJECT oBrw:aCols[ 1 ]
:cFooter:="Total"
END
WITH OBJECT oBrw:aCols[ 4 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END
For i:=6 to 7
WITH OBJECT oBrw:aCols[ i ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END
Next
oBrw:SetRDD()
oBrw:nStretchCol := STRETCHCOL_WIDEST
oBrw:MakeTotals()
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
Close All
Return
Regards
Anser