我有学生成绩
Subject Total Obtained Result
English 75 45 Pass
Maths 75 28 Fail
Science 75 25 Fail
我希望在水晶报告中,如果学生在2个或2个以上科目中失败,则返回值为“失败”的可变或公式字段,否则为“通过”
希望你们能理解我的问题。
我在公式字段中试过这个,但它没有用。
numbervar x := 0;
stringvar text := '';
if {tblExamDetail.Result} = 'Fail' then
x := x + 1;
if x >= 2 then
text = 'Fail';
else
text = 'Pass';
但它给了我错误。
答案 0 :(得分:1)
将公式添加到details
部分:
// {@test}
if {tblExamDetail.Result} = 'Fail' then
1
else
0
将此公式添加到学生组的footer
部分:
// {@passfail}
if Sum({@test},{tblExamDetail.student}) > 2 then
'Fail'
else
'Pass'