我正在使用 Birt 编写报告。
我需要根据人的性别显示颜色的边框。
例如我使用:
<property name="borderLeftColor">#05C1FF</property>
但我希望它是有条件的。
我有一个 JS 函数可以给我颜色代码。
getColorFromSexe((dataSetRow["Sexe"]))
用于
<expression name="myBorderLeftColor" type="javascript">
getColorFromSexe((dataSetRow["Sexe"]))
</expression>
我想要这样的东西:
<expression name="myBorderLeftColor" type="javascript">
getColorFromSexe((dataSetRow["Sexe"]))
</expression>
<property name="borderLeftColor">myBorderLeftColor</property>
有谁知道如何在 .rptdesign 中做这样的事情?
谢谢。
最佳答案
我的问题不是很聪明。 我将其更改为类似代码的开关盒:
<structure>
<property name="operator">eq</property>
<expression name="testExpr" type="javascript">row["Sexe"]</expression>
<simple-property-list name="value1">
<value type="javascript">2</value>
</simple-property-list>
<property name="style">liseret_rose</property>
</structure>
它工作正常。
关于css - Birt:rptdesign 中的 CSS 条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32183454/