存档

2009年11月 的存档

将报表输出HTML从ANSI转存为UTF-8格式

2009年11月24日 没有评论

IF ISCLEAR(WSC) THEN

CREATE(WSC);

WSC.Language:=’VBScript’;

//This is created by Yeats.

b[1]:=13;

b[2]:=10;

g_txtScript:=g_txtScript+’dim Str’+b;

g_txtScript:=g_txtScript+’Fl=’+’"’+flName+’"’+b;

g_txtScript:=g_txtScript+’set stm=CreateObject("Adodb.Stream")’+b;

g_txtScript:=g_txtScript+’stm.Type=2’+b;

g_txtScript:=g_txtScript+’stm.Mode=3’+b;

g_txtScript:=g_txtScript+’stm.CharSet="gb2312"’+b;

g_txtScript:=g_txtScript+’stm.Open’+b;

g_txtScript:=g_txtScript+’stm.LoadFromFile Fl’+b;

g_txtScript:=g_txtScript+’Str=stm.readtext’+b;

g_txtScript:=g_txtScript+’stm.Close’+b;

g_txtScript:=g_txtScript+’stm.CharSet="utf-8"’+b;

g_txtScript:=g_txtScript+’stm.Open’+b;

g_txtScript:=g_txtScript+’stm.WriteText Str’+b;

g_txtScript:=g_txtScript+’stm.SaveToFile Fl, 2’+b;

g_txtScript:=g_txtScript+’stm.flush’+b;

g_txtScript:=g_txtScript+’stm.Close’+b;

g_txtScript:=g_txtScript+’Set stm=Nothing’+b;

WSC.ExecuteStatement(g_txtScript);

IF NOT ISCLEAR(WSC) THEN

CLEAR(WSC);

分类: C/AL 标签: , ,