请问:
java能否调用microsoft office的dll,生成powerpoint,并在其中做出柱状图等统计性图表?
或者利用现成的jar包(例如poi.jar),操作powerpoint,在其中做出图表?过年了,急着解决问题好回家。祝新年愉快!
java能否调用microsoft office的dll,生成powerpoint,并在其中做出柱状图等统计性图表?
或者利用现成的jar包(例如poi.jar),操作powerpoint,在其中做出图表?过年了,急着解决问题好回家。祝新年愉快!
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
public class PPTTest {
private static final String PPT_FILE = E:\\a.ppt;
/**
* @param args the command line arguments
*/
// public void CC(String PPT_FILE){
// AA(PPT_FILE);
// }
public static void main(String[] args) {
//public void AA(String PPT_FILE){
// 新建一个powerpoint程序实例
ActiveXComponent ppt = new ActiveXComponent(PowerPoint.Application);
// 设置程序界面是否可见
ppt.setProperty(Visible, new Variant(true));
ActiveXComponent presentations
= ppt.getPropertyAsComponent(Presentations);
// 打开一个现有的 Presentation 对象
ActiveXComponent presentation =
presentations.invokeGetComponent(Open,new Variant(PPT_FILE),
new Variant(true));
// powerpoint幻灯展示设置对象
ActiveXComponent setting = presentation.getPropertyAsComponent(SlideShowSettings);
// 调用该对象的run函数实现全屏播放
setting.invoke(Run);
// 释放控制线程
ComThread.Release();
}
}