jsp簡單匯出word,不使用poi

2021-08-01 16:36:28 字數 575 閱讀 7776

組織處理決定表

填寫人:$$

匯出(function($),

datatype:'json',

success: function(data) }

}); };

}})(jquery);

var wordexport = new jquery.export();

@responsebody

public integer exportdisposetable(string id,string html,string filename) catch (exception e) }

public void createoutword(string descode,string html,string filename) throws ioexception  

}  } catch (ioexception e)   }

以上步奏簡單的完成word的匯出,流程是這樣的:

前台把頁面內容的html**以字串的形式傳給後台,我們在後台把html以位元組流方式讀出,讀出格式為word格式,此word內容便和你頁面的樣式一樣,不需要再為格式煩惱

jsp匯出為word文件的幾個技巧

寫道 1 步驟 技巧 在需要填寫資料的地方最好預填入一些易識別的資料,這樣方便後面填寫jsp 第二步 把htm字尾改為jsp,比如 liukun.jsp。第三步 新增jsp的頭,比如 taglib uri web inf struts bean.tld prefix bean taglib uri ...

簡單的C 匯出word(一)

stringbuilder builder new stringbuilder response.clearcontent response.buffer true response.addheader content disposition attachment filename myword.d...

使用iText匯出Word(含有Table)示例

使用itext匯出word,需要的jar包有itext 2.1.7.jar,itextasian.jar,itext rtf 2.1.7.jar expert expert new expert expert的一些屬性省略 文件屬性 document.addtitle title sample 標題...