octscorpion
BlogJava
::
首页
::
联系
::
聚合
::
管理
0 Posts :: 17 Stories :: 0 Comments :: 0 Trackbacks
留言簿
给我留言
查看公开留言
查看私人留言
我参与的团队
文章档案
2013年1月 (5)
2012年12月 (5)
2012年11月 (4)
2012年10月 (3)
搜索
最新评论
jacob打印EXCEL
public
static
void
excelPrint(String filePath)
{
ActiveXComponent xl
=
new
ActiveXComponent(
"
Excel.Application
"
);
try
{
Dispatch.put(xl,
"
Visible
"
,
new
Variant(
false
));
Dispatch workbooks
=
xl.getProperty(
"
Workbooks
"
).toDispatch();
Dispatch ex
=
Dispatch.call(workbooks,
"
Open
"
, filePath).toDispatch();
Dispatch.get(ex,
"
PrintOut
"
);
}
catch
(Exception e)
{
e.printStackTrace();
}
finally
{
xl.invoke(
"
Quit
"
,
new
Variant[]
{}
);
xl
=
null
;
}
}
posted on 2012-12-12 17:38
一G刀客
阅读(292)
评论(0)
编辑
收藏
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
Chat2DB
C++博客
博问
管理
Copyright @ 一G刀客
Powered by:
.Text
and
ASP.NET
Theme by:
.NET Monster