读书人

vml图形导出有关问题

发布时间: 2012-03-14 12:01:12 作者: rapoo

vml图形导出问题
用vml生成的柱状图
我用以下方式导出
js方式
var oWD = new ActiveXObject( "Word.Application ");
var oDC = oWD.Documents.Add( " ",0,1);
var orange =oDC.Range(0,1);
var sel = document.body.createTextRange();
sel.moveToElementText(test1);
sel.select();
sel.execCommand( "Copy ");
orange.Paste();
oWD.Application.Visible = true;

有图形,但是图上的注释文字没了

用asp方式
response.ContentType = "application/vnd.ms-word "
Response.AddHeader "Content-Disposition ", "attachment; filename=1.doc "
图片没有导出成功,就导出了一个坐标

请教不用控件成功导出方法


[解决办法]
ar oWD = new ActiveXObject( "Word.Application ");
var oDC = oWD.Documents.Add( " ",0,1);
var orange =oDC.Range(0,1);
var sel = document.body.createTextRange();
sel.moveToElementText(test1);
sel.select();
sel.execCommand( "Copy ");
orange.Paste();
oWD.Application.Visible = true;


------

代码和这个差不多 , 但是要写在服务器端 , 就是所谓的asp实现了

但前提是服务器上要装office
[解决办法]

ar oWD = new ActiveXObject( "Word.Application ");

--------

在server端: set oWD = Server.CreateObject( "Word.Application ")

读书人网 >JavaScript

热点推荐