SLP How to set Arial if a field is in Eng & 新細明體 if it is in Chi

本文由 Canyon 在 2012-02-20 發表於 "WebSAMS 討論區" 討論區

  1. 10109629

    Canyon
    Expand Collapse

    文章:
    81
    讚:
    0
    How to use Arial if a field value is in English and use 新細明體 if a field value is in Chinese?

    In SLP Report B, many programme name, programme description,... may be in Chinese or in English. Our school wants to display English using Arial while Chinese using 新細明體. Please advise. In great urgent! Thx!
     
  2. 56440610

    edb-brian
    Expand Collapse

    文章:
    382
    讚:
    0
    I will edit the OLE subreport as an example (@prog_short_txt) at Group Header 7, please follow the steps below

    1. delete the original (@prog_short_txt) at Group Header 7
    2. drag @prog_short_txt from field explorer back to Group Header 7
    3. right click formula @prog_short_txt, select 'Format Editor'
    4. On 'Common' tab, click 'Can Grow'
    5. On 'Font' tab, please make sure the default font is other than 'Arial' and click 'X-2' on the right side of 'Font'
    6. enter the formula 'if asc(trim({Command.prog_short_txt})) < 123 then "Arial"
    7. repeat the steps on another fields
     
    #2 edb-brian, 2012-02-21
  3. 10109629

    Canyon
    Expand Collapse

    文章:
    81
    讚:
    0
    Thank you! Is that checking the 1st character in the field only? I have an item "Sha-Teen Shine U Way!” Programme. Is it because of the double quotation and so it is treated as Chinese character?
     
  4. 56440610

    edb-brian
    Expand Collapse

    文章:
    382
    讚:
    0
    本帖最後由 edb-brian 於 2012-2-21 16:28 編輯

    the ASCII code of double quotation " is 34....

    please try to modify the formula to check the 2nd character

    if asc(mid(trim({Command.prog_short_txt}),2,1)) < 123 then "Arial"
     
    #4 edb-brian, 2012-02-21
  5. 56440610

    edb-brian
    Expand Collapse

    文章:
    382
    讚:
    0
    or you may try this

    if asc(trim({Command.prog_short_txt})) < 124 then "Arial"
     
    #5 edb-brian, 2012-02-21