【问题标题】:How to calculate grades based on percentage using ireports如何使用 ireports 根据百分比计算成绩
【发布时间】:2018-04-02 14:58:06
【问题描述】:

在 ireports 中如何根据百分比计算成绩。

  • Variable1 是总值的总和
  • variable2 是百分比。

基于variable2的成绩必须显示

if(variable2>=95) ? "A+" : if(variable2>=75) ? "B" 

等等。我尝试过使用“printwhenexpresssion”属性,但它给出了错误

如何在 ireports 中表示这一点?

【问题讨论】:

标签: jasper-reports


【解决方案1】:

您可以放置​​一个文本字段,其表达式为:

variable>= 95 ? "A+" : (variable>= 75 ? "B" : "something")

根据Java Ternary Operator inside ternary operator

它将根据您的需要进行评估

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-21
    • 2014-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    相关资源
    最近更新 更多