在这里,我试图将附图导出到按钮click.First上的ppt,我正在将附图转换为图像,然后将它们导出到ppt.As,我需要在保存图像后生成ppt,我正在使用javascript中的秒表函数来计算将附图转换为image.This所需的时间,这是我的代码:
<script type="text/javascript">
var initiateExport = false;
var _sw = new StopWatch();
var time;
function exportReport() {
exportCharts();
return false;
}
function exportCharts() {
_sw.start();
var exportFormat = 'JPG';
initiateExport = true;
for (var chartRef in FusionCharts.items) {
if (FusionCharts.items[chartRef].exportChart) {
document.getElementById("linkToExportedFile").innerHTML = "Exporting...";
FusionCharts.items[chartRef].exportChart({ "exportFormat": exportFormat });
}
else {
document.getElementById("linkToExportedFile").innerHTML = "Please wait till the chart completes rendering...";
}
}
}
function FC_Exported(statusObj) {
_sw.stop();
time = _sw.duration();
setTimeout(' document.getElementById("MainContent_Button1").click();', time);
}
</script>在上面的代码中,document.getElementById("MainContent_Button1").click();函数生成的ppt.My问题是,由于我有3个附图,函数FC_Exported被执行了3次times.So,我得到了ppt 3次的提示。,我希望它只发生1次.Also,我认为ppt代码的位置不能更改,因为我使用time parameter.Can,请给我指点?等待你的response.Thank你。
注意:定时器的停止功能不能放在其他地方,因为我想要生成和保存图像所需的总时间.
发布于 2012-07-05 05:58:18
您可以尝试使用来自FusionCharts的FusionCharts。它是为PowerPoint '03和更高版本。
发布于 2014-01-14 06:28:47
最近,我用汇总图作为ppt输出。这一过程非常简单,具体如下:
- Capture image from the client side
- Save Image at server side
- Use Apache POI to create a slideshow
- Add stored image in slide as :
// get server context
ServletContext context = request.getServletContext();
// get image stored file path
String []imagefilename=filename.split("/ExportedImages");
// get image filename
String filename = context.getRealPath("/ExportedImages"+imagefilename[1]);
// Create Slide
Slide slide1 = slideShow.createSlide();
try {
int idx=slideShow.addPicture(new File(filename), org.apache.poi.hslf.model.Picture.JPEG);
org.apache.poi.hslf.model.Picture pict = new org.apache.poi.hslf.model.Picture(idx);
//set image position in the slide
pict.setAnchor(new java.awt.Rectangle(100, 100, 300, 200));
slide1.addShape(pict);
} catch (IOException e1) {
e1.printStackTrace();
}
- Then Download file https://stackoverflow.com/questions/11323257
复制相似问题