帮助原文是这样写的:
BI Publisher supports the common programming construct "if-then-else". This is extremely useful when you need to test a condition and conditionally show a result. For example:
IF X=0 THEN
Y=2
ELSE
Y=3
END IF
You can also nest these statements as follows:
IF X=0 THEN
Y=2
ELSE
IF X=1 THEN
Y=10
ELSE Y=100
END IF
Use the following syntax to construct an if-then-else statement in your RTF template:
<?xdofx:if element_condition then result1 else result2 end if?>
For example, the following statement tests the AMOUNT element value. If the value is greater than 1000, show the word "Higher"; if it is less than 1000, show the word "Lower"; if it is equal to 1000, show "Equal":
<?xdofx:if AMOUNT > 1000 then 'Higher'
else
if AMOUNT < 1000 then 'Lower'
else
'Equal'
end if?>
我给大家加个例子:
stime: <?stime?>
F: <?for-each:WIND_DATA1_ROW?>
dayday : <?dayday?>
wdpower123 : <?xdofx:if wdpower=-1 then '无采样数据' else wdpower end if?>
{这里特别说明:这个就是if,else的用法了:如果wdpower这个变量里的值是-1,则显示'无采样数据' ,else否则,显示变量wdpower里的数据}
fs:<?fs?>
E:<?end for-each?>
瞬时最大功率
整点风速
看一下结果:

else wdpower end if?>