SLP SLP: 請教有關報表內的Formula

本文由 Miss Chung 在 2011-05-30 發表於 "WebSAMS 討論區" 討論區

  1. 55036539

    Miss Chung
    Expand Collapse

    文章:
    120
    讚:
    0
    在R-SLP009.rpt中,有一個Sub-report(OLE.rpt) ,其中「獎項/ 證書文憑/ 成就」的公式如下:
    請教各位,如何我期望:若獎項的中文及英文相同(早前編Code Table 時兩者也入了如「200M亞軍」,又唔想譯番英文)報表就只出中文,否則就中及英都出(例如:參與證書Certificate of Participation),我可以如何改動以下的公式呢?

    if ({?printLanguage} = "both" )
    then
    join(filter (makearray(
    NthMostFrequent (1, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (10, {Command.awards_chi_txt}, {Command.prog_short_en_des})
    ),"",true),', ') + chr(13) +
    join(filter (makearray(
    NthMostFrequent (1, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (10, {Command.awards_en_txt}, {Command.prog_short_en_des})
    ),"",true),', ')
    else if ({?printLanguage} = "english" and {?accessToEngOrChiContent} = 't')
    then
    join(filter (makearray(
    NthMostFrequent (1, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.award_en_ch_des}, {Command.prog_short_en_des}),
    NthMostFrequent (10, {Command.award_en_ch_des}, {Command.prog_short_en_des})
    ),"",true),', ')
    else if ({?printLanguage} = "chinese" and {?accessToEngOrChiContent} = 't')
    then
    join(filter (makearray(
    NthMostFrequent (1, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.award_ch_en_des}, {Command.prog_short_en_des}),
    NthMostFrequent (10,{Command.award_ch_en_des}, {Command.prog_short_en_des})
    ),"",true),', ')
    else if ({?printLanguage} = "english")
    then
    join(filter (makearray(
    NthMostFrequent (1, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.awards_en_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (10, {Command.awards_en_txt}, {Command.prog_short_en_des})
    ),"",true),', ')
    else if ({?printLanguage} = "chinese" )
    then
    join(filter (makearray(
    NthMostFrequent (1, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (2, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (3, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (4, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (5, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (6, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (7, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (8, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (9, {Command.awards_chi_txt}, {Command.prog_short_en_des}),
    NthMostFrequent (10, {Command.awards_chi_txt}, {Command.prog_short_en_des})
    ),"",true),', ')
     
    #1 Miss Chung, 2011-05-30
  2. 56440610

    edb-brian
    Expand Collapse

    文章:
    382
    讚:
    0
    做不到老師要求
    建議老師到獎項/ 證書文憑/ 成就的code tabe,將英文說明刪除,只留下中文說明。
     
    #2 edb-brian, 2011-06-02
  3. 55036539

    Miss Chung
    Expand Collapse

    文章:
    120
    讚:
    0
    若我只限定"水運會" 或 "陸運會"又如何呢?
    謝謝你!
    Miss Chung
     
    #3 Miss Chung, 2011-06-07
  4. 56953375

    edb-石頭
    Expand Collapse

    文章:
    1,160
    讚:
    0
    要做到老師的效果, 必須更改stored procedure. 所以最簡單的方法就是之前所建議的:
    到獎項/ 證書文憑/ 成就的code tabe,將英文說明刪除,只留下中文說明。
     
    #4 edb-石頭, 2011-06-08
  5. 55036539

    Miss Chung
    Expand Collapse

    文章:
    120
    讚:
    0
    OIC, thanks!! ^_^
     
    #5 Miss Chung, 2011-06-08