您现在的位置是:首页 > 电脑技术查询 > web开发

vml图形导出有关问题

编辑:chaxungu时间:2022-10-02 23:18:49分类:web开发

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 ")