緊急!科目評語問題(SSTAM請幫幫手)

本文由 KC 在 2005-11-29 發表於 "WebSAMS 討論區" 討論區

  1. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    因為發覺shared會令都本來冇科評的人地會無啦啦出現科評,所以改做local試下,但結果還是一樣,會唔會要dim 兩個variable分別俾中,英文用?謝謝

     

     
  2. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    [parsehtml]<P>I guess it is the problem of the report design. Try the following steps and see whether the problem can be solved.</P> <P>Select <STRONG>Group Expert</STRONG> and then select <EM>Options</EM>. Change the field to TB_ASR_RptPStudent.Class and then test again.</P>[/parsehtml]
     
    #22 SIM - SS Tam, 2005-12-05
  3. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    唔好意思,我應該說清一點,其實遇到兩個問題:

    1.就是用shared會令都本來冇科評的人地會無啦啦出現科評的問題,我是用成績表P中的sub-report出等級,是不是要用Group Expert and then select Options. Change the field to TB_ASR_RptPStudent.Class去改?

    2.是上述提過如將同樣程式放在cross-tab去run,結果是沒有一個人有科評

    謝謝你的幫忙!

     
  4. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    [parsehtml]<P>OH! I get confused.</P> <P>Do you making cross-tab or using other way to display the comment???</P> <P>Please make your question clear and use a new thread since this thread is too long.</P>[/parsehtml]
     
    #24 SIM - SS Tam, 2005-12-05
  5. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    真的唔好意思:

    問題1:

    在report P出分的subreport裏的"Grade",用了以下公式,

    發覺有d應該冇科評的人卻變左有,應該有的當然可以正常顯示,應如何是好?

    shared stringVar compComment;
    {@Grade_ATA2}+
    (
    if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
      (if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文作文')) then
         compComment
       else
         '')
    else
      if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then
        ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
            compComment := ''
          else
            compComment := {tb_asr_rptpSCORE.ChComment_ATA2});
        '')
      else (
        compComment := '';
        {tb_asr_rptpSCORE.ChComment_ATA2})
      )

     
  6. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    第2個問題係用同樣的程式,當用在大榜時,郤任何科評不能顯示:

    其實小弟是用了http://resources.emb.gov.hk/sa2410/edcity/Templates/reportps1/reportps1.rpt

    的大榜表(P表)

    當中的cross-tab有 @detail 公式, 內裏使用 {@grade_ata2};

    {@grade_ata2}則寫有以下之公式

    shared stringvar compcomment;
    if {@#SETTING_ATA2_DROPEXEMPTIND} <> ' ' then
        {@#SETTING_ATA2_DROPEXEMPTIND}
    else if {@#SETTING_ATA2_ASSBYGRADE} = 'Y' then
      if {@#SETTING_ATA2_PASSIND} = 'Y' then
        trim(left({TB_ASR_RPTPSCORE.ENGRADE_ATA2}, 2)) + (
    if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
      (if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文讀本')) then  compComment
       else
         '')
    else
      if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then
        ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
            compComment := ''
          else
            compComment := '*');
        '')
      else  (
        compComment := '';

        '*')
    )
      else
      '(' + trim(left({TB_ASR_RPTPSCORE.ENGRADE_ATA2}, 2))+')'
    else
    if {@#SETTING_ATA2_PASSIND} = 'Y' then
        totext(tonumber({TB_ASR_RPTPSCORE.SCORE_ATA2}),0) + (
    if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
      (if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文讀本')) then  compComment
       else
         '')
    else
      if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then
        ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
            compComment := ''
          else
            compComment := '*');
        '')
      else  (
        compComment := '';

        '*')
    )
     else
     '(' + totext(tonumber({TB_ASR_RPTPSCORE.SCORE_ATA2}),0)+')' 

    然而,小弟在未有分卷問題時,各科能正常顯示以 *號代替之科目評語(如下)

              中國語文          英國語文          
                        中文讀本          英文作文   數學  ........ 

    1.陳小明    80*   79       90*      92       85*
    2.陳大明    60     62       91*      100     90*

    可是,當改寫了公式後,中英文科的科評消失了,也沒有顯示到分卷上,但其他各科則正確:

              中國語文          英國語文          
                        中文讀本          英文作文   數學  ........ 

    1.陳小明    80     79       90      92       85*
    2.陳大明    60     62       91      100     90*

    是不是要用Group Expert and then select Options. Change the field to TB_ASR_RptPStudent.Class去改?

    很感謝SS-Tam再花時間和心機替小弟解決困難,謝謝! :)

     
  7. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    [parsehtml]<P>For question 1, is there more than one column of score? If so, you need to use difference variable name for the component comment.</P> <P>&nbsp;</P>[/parsehtml]
     
    #27 SIM - SS Tam, 2005-12-05
  8. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    For question 1, is there more than one column of score? If so, you need to use difference variable name for the component comment.

    成績表P的顯示形式如下(實際上與websams內提供的樣版無異)
                                    第一次考試

                     中國語文      70 *
                     - 中文讀本    90
                     - 中文作文    75

                     英國語文      80 *
                     - 英文讀本   90
                     - 英文作文   75

                     數學        100*

                     宗教          60

     現想將在中英文總分顯示的科評自動從科目調到分卷:
                                  第一次考試

                      中國語文     70
                     - 中文讀本   90*
                     - 中文作文   75

                      英國語文   80 
                     - 英文讀本  90
                     - 英文作文  75*

                       數學        100*

     
  9. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0
    或許先解決問題一吧!因來得比較急.經連日來的測試,發覺當某一位同學成績有科評(是正常的需要有),通常下一位便會無端端有科評(他應該是沒有的).情況就好像程式記住了某些東西或loop死了,小弟想了幾晚也不能解,盼能指點迷津,謝謝
     
  10. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    [parsehtml]<P>Please try the following one and see whether it solve the problem.</P> <P>shared stringvar compcomment;<BR>if {@#SETTING_ATA2_DROPEXEMPTIND} &lt;&gt; ' ' then<BR>&nbsp;&nbsp;&nbsp; {@#SETTING_ATA2_DROPEXEMPTIND}<BR>else if {@#SETTING_ATA2_ASSBYGRADE} = 'Y' then<BR>&nbsp; if {@#SETTING_ATA2_PASSIND} = 'Y' then<BR>&nbsp;&nbsp;&nbsp; trim(left({TB_ASR_RPTPSCORE.ENGRADE_ATA2}, 2)) + (<BR>if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then <BR>&nbsp; (<FONT color=#ff0000>if isnull({TB_ASR_RptPScore.CHSUBJCOMNAME}) then compComment := '';</FONT><BR>if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文讀本')) then&nbsp; compComment<BR>&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp; '')<BR>else <BR>&nbsp; if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then<BR>&nbsp;&nbsp;&nbsp; ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compComment := ''<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compComment := '*');<BR>&nbsp;&nbsp;&nbsp; '')<BR>&nbsp; else&nbsp; (<BR>&nbsp;&nbsp;&nbsp; compComment := '';</P> <P>&nbsp;&nbsp;&nbsp; '*')<BR>)<BR>&nbsp; else<BR>&nbsp; '(' + trim(left({TB_ASR_RPTPSCORE.ENGRADE_ATA2}, 2))+')'<BR>else <BR>if {@#SETTING_ATA2_PASSIND} = 'Y' then<BR>&nbsp;&nbsp;&nbsp; totext(tonumber({TB_ASR_RPTPSCORE.SCORE_ATA2}),0) + (<BR>if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then <BR>&nbsp; (<FONT color=#ff0000>if isnull({TB_ASR_RptPScore.CHSUBJCOMNAME}) then compComment := '';</FONT><BR>if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文讀本')) then&nbsp; compComment<BR>&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp; '')<BR>else <BR>&nbsp; if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then<BR>&nbsp;&nbsp;&nbsp; ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compComment := ''<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compComment := '*');<BR>&nbsp;&nbsp;&nbsp; '')<BR>&nbsp; else&nbsp; (<BR>&nbsp;&nbsp;&nbsp; compComment := '';</P> <P>&nbsp;&nbsp;&nbsp; '*')<BR>)<BR>&nbsp;else<BR>&nbsp;'(' + totext(tonumber({TB_ASR_RPTPSCORE.SCORE_ATA2}),0)+')'&nbsp; <BR></P>[/parsehtml]
     
    #30 SIM - SS Tam, 2005-12-06
  11. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    For question 2, do the same modification as question1, and then make the change to the group setting as I mentioned. If there is any problem, state the full picture since I need more information to locate the error source.
     
    #31 SIM - SS Tam, 2005-12-06
  12. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    謝謝SS Tam連日來抽空替我解決問題!

    經試後Question 1問題己解決,可順利印出成績表,但question 2在改用修正的程式及轉group option後,,反而令系統不能製造pdf 大榜檔案(即websams右欄什麼也沒有,空白一片,又不會另開視窗彈pdf檔案出來)

     

     
  13. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    The behaviour indicate that there should be something wrong in the formula. I suggest you test the report in the workstation so you can see the error. Tell me the error so I can made suitable modification.
     
    #33 SIM - SS Tam, 2005-12-08
  14. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0

    Dear SS Tam,

    I have tested the report and it said the following error:

    "A print time formula that modifies variables is used in a chart or map Details: @detail"

    the code of  "detail"  in that summarized field in cross-tab is like that:

    shared stringVar compComment;
    {@Grade_ATA2} +
     (
    if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
      (if isnull({TB_ASR_RptPScore.CHSUBJCOMNAME}) then compComment := '';
    if (not isnull({TB_ASR_RptPScore.CHSUBJCOMNAME})) and ((trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '中文讀本') or (trim({TB_ASR_RptPScore.CHSUBJCOMNAME}) = '英文讀本')) then  compComment
       else
         '')
    else
      if ({TB_ASR_RptPScore.CHSUBJNAME} = '中國語文') or ({TB_ASR_RptPScore.CHSUBJNAME} = '英國語文') then
        ((if isnull({tb_asr_rptpSCORE.ChComment_ATA2}) or len({tb_asr_rptpSCORE.ChComment_ATA2}) = 0 then
            compComment := ''
          else
            compComment := '*');
        '')
      else  (
        compComment := '';

        '*')
    )

    附大表參考

    http://resources.emb.gov.hk/sa2410/edcity/Templates/reportps1/reportps1.rpt

     

     

     
  15. SIM - SS Tam

    SIM - SS Tam
    Expand Collapse

    According to the message, I think it is the limitation of the cross-tab feature so there is no way to produce the output as you needed.
     
    #35 SIM - SS Tam, 2005-12-12
  16. 10517336

    KC
    Expand Collapse

    文章:
    24
    讚:
    0
    那麼,有沒有辦法可以修改那大榜?