羅伯特 發表在 痞客邦 留言(0) 人氣(308)
最近剛好碰上在 Java Servlet 上,
把網頁的資料轉成 Excel 檔的程式 , 在此紀錄一下...
這是一般網頁的格式
--輸出
HTTP/1.1 200 OK
Date: Wed, 14 Oct 2009 02:48:37 GMT
Server: Oracle-Application-Server-10g/9.0.4.3.0 Oracle-HTTP-Server
Pragma: no-cache
Cache-Control: no-cache
Keep-Alive: timeout=5, max=500
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=euc-kr
這是 Excel 檔案格式,以供下載
--原始碼
response.setContentType("text/html; charset=euc-kr");
--輸出
HTTP/1.1 200 OK
Date: Wed, 14 Oct 2009 02:48:52 GMT
Server: Oracle-Application-Server-10g/9.0.4.3.0 Oracle-HTTP-Server
Pragma: no-cache
Cache-Control: no-cache
Content-Disposition: inline;filename=BOM_TXTHSM1908000BT.xls
Keep-Alive: timeout=5, max=500
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/x-excel;name='My_excel';charset=euc-kr
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
--原始碼
response.setContentType("application/x-excel;name='My_excel';charset=euc-kr");
response.setHeader("Content-Disposition","inline;filename="+date_wc+".xls");
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-kr\">");
另外發現這個網頁有 ContentType 可供參考
http://blog.sina.com.tw/supermomo/article.php?pbgid=51237&entryid=574444
一些較常用的 ContentType
GIF images ==> image/gif"
JPEG images ==> image/jpeg"
TIFF images ==> image/tiff"
MICROSOFT WORD document ==> application/msword"
RTF document ==> application/rtf"
MICROSOFT EXCEL document ==> application/x-excel"
MICROSOFT POWERPOINT document ==> application/ms-powerpoint"
PDF document ==> application/pdf"
ZIP document ==> application/zip"
羅伯特 發表在 痞客邦 留言(0) 人氣(739)
利用 smitty vg 來備份 Datavg 時, 總是遇到下列錯誤...
0512-005 savevg : Backup Completed .........with errors
羅伯特 發表在 痞客邦 留言(0) 人氣(487)
離開 Korea Folk Villiage 之後,我們繼續轉戰景福宮
羅伯特 發表在 痞客邦 留言(1) 人氣(105)
藉著一個奇怪又突然的機會,在 H1N1 病毒準備開始大爆發的時候,
Robert 竟然又要去韓國出差了,原本在這種時機下,不應該趴趴走的...
公司主管原本也向總公司說基於安全考量,將減少出國的機會。
但是這次的 Orientation ,有來自其他國家的同事,
全世界都到,台灣怎麼可以缺席呢?
在這情況下,Robert只好帶的滿滿的口罩&老婆大人特製的ClO2滅百菌,
前往韓國,來一段搶救睡眠品質大作戰,
(PS:因為連日來小棒每晚都會起來鬧個兩三次,Robert睡眠也跟著亂七八糟)
羅伯特 發表在 痞客邦 留言(0) 人氣(100)

之前一直有這困擾,今天突然找到這個了
下次來試試看
From Here
http://support.microsoft.com/kb/894564/zh-tw
羅伯特 發表在 痞客邦 留言(0) 人氣(1,806)
羅伯特 發表在 痞客邦 留言(0) 人氣(566)
MSN 安裝錯誤 0x80070652
今天接到 user 的電話說 , MSN (Windows Live Messenger) 又強制要升級9.0了
可是它一直出現安裝錯誤, 說是某個安裝正在進行 , 錯誤碼 0x80070652
羅伯特 發表在 痞客邦 留言(2) 人氣(4,743)