background image
finereport.js 使用的是 jquery 框架,若用户也使用了 jquery,可能会造成冲突,这时
建议不要引入 finereport.js,而是将 cjkEncode 方法拷贝到页面中直接使用,详见下面的
方法。
 
已完成示例请参照
%FR_HOME%\WebReport|page_demo\parameter_ch.html
 
2.2 直接调用 cjkEncode 
加载 finereport.js 再引用 cjkEncode,一方面可能会引起 js 冲突,另一方面也加载了
很多不必要的方法。 
若用户只需要使用该方法,可以将 cjkEncode 实现的代码复制到网页中戒者用户自己的
js 文件中,然后再引用 cjkEncode。 
1.
 
<html>  
 
2.
 
  <head>    
 
3.
 
  <title>FineReport Demo</title>    
 
4.
 
  <meta http-equiv=
"Content-Type"
 content=
"text/html; charset=GBK"
 />
    
 
5.
 
  <script type=
"text/javascript"
>  
 
6.
 
    
//cjkEncode
方法的实现代码,放在网页 head 中戒者用户自己的 js 文件中
  
 
7.
 
    function cjkEncode(text) {                                       
                                     
 
8.
 
      
if
 (text == 
null
) {         
 
9.
 
        
return
 
""
;         
 
10.
 
      }         
 
11.
 
      var newText = 
""
;         
 
12.
 
      
for
 (var i = 
0
; i < text.length; i++) {         
 
13.
 
        var code = text.charCodeAt (i);