Picture in dcbrowseol

This forum is for eXpress++ general support.
Message
Author
User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: Picture in dcbrowseol

#11 Post by TWolfe »

Give this a try:

DCBROWSECOL ELEMENT 6 HEADER "Qty" PARENT oBrowse;
ID 'FIRST';
EDITOR 'IQTY';
PICTURE {||svc_test(cVar)};
WIDTH 8

-----------------

function svc_test(cVar)
LOCAL ret_val := '99999'
if at(cVar,'HRS;HR ')>0
ret_val:= '99999.99'
endif
return ret_val

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Picture in dcbrowseol

#12 Post by skiman »

BruceN wrote:cVar is the item type that gets sent to the function to determine if it should be decimal or not.
But where is it defined?
Best regards,

Chris.
www.aboservice.be

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Picture in dcbrowseol

#13 Post by BruceN »

I don't have cVar in my actual code; what is actually passed is editArray[nchoice,16], but I replaced it in the sample with cVar because it was easier to type :) and irrelevant as long as the value being passed was correct (and it is).

I have tried the suggestions and a few other things I could think of ... what always happens is the picture clause for the entire column is being set/changed based on the following:

When you first come into the grid, it uses the picture setting from the first item in the grid; if it is a service item, all items in the column show with decimals; if it is not, then they all show 99999. Then if I edit one of the items, the picture setting for the entire column will change to match the picture setting for that line ... so if it is a service item, all lines will be decimal and it if is a regular item, then all items go to 99999.

The bottom line is the picture clause is being read and reevaluated based on the item, but then it is setting the picture for the entire column and not just the cell. My goal is to be able to have this evaluated for each cell in the column so that they can display differently based on the item type.
There are only 10 kinds of people - those who understand binary and those who don't :)

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Picture in dcbrowseol

#14 Post by skiman »

Maybe the following will help.

Code: Select all

dcbrowsecol data {|| if(DC_GetColArray(16,oBrowse)$"HR HRS",str(DC_GetColArray(6,oBrowse),7,2),str(DC_GetColArray(6,oBrowse),8) ) }
I think that the picture can't be set by cell.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Picture in dcbrowseol

#15 Post by rdonnay »

If the picture clause doesn't work then try using Transform() in the data code block.

Example:

Code: Select all

DCBROWSECOL DATA {|c|c := aData[2,oBrowse:arrayElement], Transform(c,IIF(SvcTest(c),'99999.99','99999'))}
The eXpress train is coming - and it has more cars.

Post Reply