FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Multiple cEditPicture on the Same Column
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
xBrowse Multiple cEditPicture on the Same Column
Posted: Thu Mar 04, 2010 09: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


I tried the following code, but it is giving run time error.
Code (fw): Select all Collapse
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
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: xBrowse Multiple cEditPicture on the Same Column
Posted: Thu Mar 04, 2010 09: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 (fw): Select all Collapse
oBrw:Petrol:cEditPicture:={ || iif(oBrw:Petrol:Value > 200,"@Z Rs.9,999","@Z 9999 Ltr") }


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




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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Multiple cEditPicture on the Same Column
Posted: Thu Mar 04, 2010 09: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
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: xBrowse Multiple cEditPicture on the Same Column
Posted: Thu Mar 04, 2010 09: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

Continue the discussion