jsp頁面資料匯入word

2021-05-21 12:52:30 字數 684 閱讀 5555

一、把jsp頁面資料複製到word文件

二、把jsp頁面資料寫入word文件

var table=document.getelementbyid('printtable');

row=table.rows.length;

column=table.rows(1).cells.length;

thearray=new array();

//將頁面中**的內容存放在陣列中

for(i=0;i

thearray[i]=new array();

for(j=0;j

thearray[i][j]=table.rows(i).cells(j).innerhtml; }

}var range = wddoc.range(0,0);

range.text="<%=reporttitle%>"+"/n";

var objtable=wddoc.tables.add(rngcurrent,row,column)     //插入**

for(i=0;i

for(j=0;j

objtable.cell(i+1,j+1).range.text = thearray[i][j].replace(" ",""); }

}

Jsp頁面Word文件的生成

2.將word文件另存為htm格式,如果存為篩選過的網頁 html 則相關的頁首頁尾等格式資訊會丟失。3.將html的內容拷貝到jsp頁面即可。並將原先填充的內容用動態內容替換即可。如果要以附件形式顯示,則在jsp頁面中加入以下 string filename jl 6 11 5市場巡查情況記錄表....

前端頁面預覽word 頁面預覽Word

一 使用jacob預覽word 分為兩步走 引入pom檔案 提取碼 6poh com.jacob jacob 1.19 system lib jacob.jar 1 首先把word轉換為pdf,如下 public booleanword2pdf string inputfile,string pdf...

JSP生成word檔案

1 jsp生成word檔案,直接改動jsp格式 pagepageencoding gb2312 string filename word.doc byte bt filename.getbytes gb2312 string unicostr new string bt,iso 8859 1 res...