I want to run an if else on base of a commandfield on each row,
For example
If {CommandField=0} Update counter by 1 return counter
else if {CommandField=1} return 'Reporting'
I tried it but having error
stringVar layerType;
shared numberVar layNo;
if({Command.ISREPORT}=0) then
layNo:=layNo+1;layerType:=layNo;layerType
else if ({Command.ISREPORT}=1) then
layerType:='Reporting'; layerType
results should be like
ISREPORT LayerNo
0 1
0 2
0 3
0 4
1 'Reporter'
Not sure I understand but is this right:
…which can be simplified to this:
..assuming the value of ISREPORT can only be 0 or 1 then we can further simplify to this:
Update – I’ve changed the last example to reset the counter on ‘reporting’.
Edit:
change the ToText(.. to this
ToText(layNo,0);(sets decimal places to zero)