xBrowse Multiple cEditPicture on the Same Column

xBrowse Multiple cEditPicture on the Same Column

Postby anserkk » Thu Mar 04, 2010 9:10 am

Hi,

Based on a specific condition, can I have multiple cEditPicture on the same column in xBrowse

I am using array in xBrowse and I have a column named Petrol Allowance, this column may contain values either in Litres or Amount. I can identify whether the figure in this column is in Litre or Amount by identifying the value of the column

For. Eg If the Value is > 500 means it is amount, if it is less than 500 then it is in Ltr

A Screen Snapshot to demonstrate the problem
Image

I tried the following code, but it is giving run time error.
Code: Select all  Expand view
oBrw:Petrol:cEditPicture:={ || iif(oBrw:Petrol:Value > 200,"@Z Rs.9,999","@Z 9999 Ltr") }


Error
Application
===========
Path and name: D:\Apps\EmpViewer\EmpViewer.exe (32 bits)
Size: 1,860,608 bytes
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 04-03-2010, 13:26:32
Error description: Error BASE/1082 Argument error: -
Args:
[ 1] = U
[ 2] = N 3

Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINTHEADER(1475)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1271)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(1174)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1439)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10470)
Called from: .\source\classes\WINDOW.PRG => _FWH(3378)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(345)
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(27)
Called from: .\source\function\VALBLANK.PRG => CVALTOSTR(105)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ARRCELL(3983)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN:ADJUST(7742)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:ADJUST(7825)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST(925)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE(833)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:CREATEFROMCODE(727)
Called from: .\EmpViewer.PRG => VIEWLIST(236)


Regards
Anser
Last edited by anserkk on Thu Mar 04, 2010 9:15 am, edited 1 time in total.
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xBrowse Multiple cEditPicture on the Same Column

Postby anserkk » Thu Mar 04, 2010 9:11 am

Hi,

With Mr.Rao's help I solved the problem. The work round was suggested by Mr.Rao. Thanks to Mr.Rao.

Instead of cEditPicture
Code: Select all  Expand view
oBrw:Petrol:cEditPicture:={ || iif(oBrw:Petrol:Value > 200,"@Z Rs.9,999","@Z 9999 Ltr") }


Used bStrData
Code: Select all  Expand view
oBrw:Petrol:bStrData:={ || Transform( oBrw:Petrol:Value, If( oBrw:Petrol:Value > 200, "@Z 9,999 Rs.", "@Z 9999 Ltr") ) }


Image

I am yet to find a solution to diplay the value as Rs.2,000 instead of 2,000 Rs. This is something to do with the function Transform()

If I use "@Z Rs.9,999" then I am getting the out put as Rs.***

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: xBrowse Multiple cEditPicture on the Same Column

Postby nageswaragunupudi » Thu Mar 04, 2010 9:21 am

Use the picture '@Z Rs 9999999'. Do not use 'Rs.' Dot in the picture clause is considered as decimal place.

'Rs' should be normally acceptable to the users. If you are very particular of the dot in Rs., then use StrTran( Transform( n, '@Z Rs 999999' ), 'Rs', 'Rs.' )
Regards

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

Re: xBrowse Multiple cEditPicture on the Same Column

Postby anserkk » Thu Mar 04, 2010 9:30 am

Dear Mr.Rao,

Mr.Rao wrote:Use the picture '@Z Rs 9999999'. Do not use 'Rs.' Dot in the picture clause is considered as decimal place.

Perfect!!! Thank you. The dot was the problem. Picture '@Z Rs 9999999' served my purpose

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 108 guests