If-then-Else Statements--RTF文档

BI Publisher支持类似于"if-then-else"的编程结构,允许根据条件展示结果。例如,可以嵌套使用这些语句来测试元素值,如AMOUNT。如果值大于1000显示"Higher",小于1000显示"Lower",等于1000则显示"Equal"。
摘要由CSDN通过智能技术生成

帮助原文是这样写的:

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?>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值