曾使用websams內 Student Transcript A (R-ASR032-E)作自訂成績scale 想抽取學生歷年成績,隨著學生升級,scale會改變 例如: 1-4年級 A 90 - 100% B 75 - 89% C 60 - 74% D 30 - 59% E 0 - 29% 5-6年級 A 85 - 100% B 75 - 84% C 60 - 74% D 30 - 59% E 0 - 29% 中一至中三 A 85 - 100% B 70 - 84% C 50 - 69% D 30 - 49% E 0 - 29% 中四至中六 A 80 - 100% B 65 - 79% C 45 - 64% D 30 - 39% E 0 - 29% Crystal Report 內的language是這樣的 SHARED NUMBERVAR cntYear; if cntYear<DistinctCount({Command.schyear}) then( cntYear := cntYear + 1; )else( cntYear := 1; ); if not isnull({Command.bygradeind}) and {Command.bygradeind} = 'Y' then ( if isnull({Command.nameeng}) then '---------' else( stringvar bygrade; bygrade := Trim(left({Command.nameeng},3)); if ToNumber(bygrade) >= 5 then 'A' else if ToNumber(bygrade) >= 4 then 'B' else if ToNumber(bygrade) >= 3 then 'C' else if ToNumber(bygrade) >= 2 then 'D' else if ToNumber(bygrade) >= 1 then 'E'); ) else if not isnull({Command.exdrptype}) then {Command.exdrptype} else ( stringvar score; stringvar grade; if isnull({Command.percscore}) then score := ' ' else score := totext({Command.percscore}, '###.##'); if isnull({Command.nameeng}) then grade := ' ' else( //grade := left({Command.nameeng},3) if ToNumber(score) >= 85 then grade := 'A' else if ToNumber(score) >= 70 then grade := 'B' else if ToNumber(score) >= 50 then grade := 'C' else if ToNumber(score) >= 30 then grade := 'D' else if ToNumber(score) >= 0 then grade := 'E' ); // for grade alignment if len(grade) = 1 then grade := grade + ' '; select {?scoreorgrade} case 'GRADE': if isnull({Command.nameeng}) then '---------' else grade case 'SCORE': if isnull({Command.percscore}) then '---------' else score default: if isnull({Command.percscore}) and isnull({Command.nameeng}) then '---------' else score +' ' + grade )
老師,請參考以下: 由於 學生歷年成績紀錄表A (R-ASR032-E) (英文版), 在 score 子報表內, Command 本身沒有顯示 classlvl 欄位, 需要修改 Command SQL, 增加顯示 classlvl 欄位。 然後,再修改 formula @scoregrade, 用 classlvl 欄位, 按照 不同年級,使用不同分數 scale。