JAVA excel
<%
response.setContentType("application/vnd.ms-excel;charset=utf-8");
String reportname = (String)request.getAttribute("reportname");
String reportFileName=java.net.URLEncoder.encode(reportname, "UTF-8");
String filenamedisplay =reportFileName+".xls";
response.addHeader("Content-Disposition","attachment;filename=" + filenamedisplay);//Ôö¼ÓĬÈϱ£´æÎļþÃû
String userid = (String)request.getAttribute("_fm_userid");
int index=0;
%>
<html>
<head>
<title><%=reportname%>²é詢Áбí</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<%
File file=new File("G:/Eclipse.pdf");//ÎļþÀàÐÍ ¿ÉÒÔΪPDF XLS DOC
FileInputStream in=new FileInputStream(file);
byte [] b=new byte[1024];
response.setContentType("application/pdf;charset=GB2312");//application/pdf /msxml(excel) /msword
//response.setHeader("Content-Disposition", "attachment; filename=9602.pdf");//ÏÂÔØ
int len;
while((len=in.read(b))>0)
response.getOutputStream().write(b,0,len);
%>
///////////////////////////////////////////////////////////////////
ÔÚweb.xmlÖмÓÈë
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
<mime-mapping>
<extension>xls</extension>
<mime-type>application/msexcel&l
Ïà¹ØÎĵµ£º
Ò»£¬Ï̵߳ÄËĸöÖ÷ÒªÖÜÆÚ״̬ÊÇ“´´½¨”£¬“¿ÉÖ´ÐД£¬“·Ç¿ÉÖ´ÐД£¬“ÏûÍö”£¬×´Ì¬×ª»»¹ØÏµÈçÏÂͼ£º
£¨1£©´´½¨¡£µ±ÊµÀý»¯Ò»¸öthread¶ÔÏó²¢Ö´ÐÐstart()·½·¨ºó£¬Ï߳̽øÈë“¿ÉÖ´ÐД״̬¿ªÊ¼Ö´ÐС£ËäÈ»¶àÏ̸߳øÓû§Ò»ÖÖͬʱִÐеļÙÏ󣬵«ÊÂʵÉÏÔÚͬһʱ¼äµãÄÚ£¬Ö»ÓÐÒ»¸ö ......
2009Äê08ÔÂ12ÈÕ ÐÇÆÚÈý 10:31 A.M.
Éú³É¾²Ì¬Ò³Ãæ¼¼Êõ½â¾ö·½°¸Ö®Ò»
×ªÔØÕßǰÑÔ£ºÕâÊÇÒ»¸öÈ«ÃæµÄjsp¶¯Ì¬Ò³Ã澲̬»¯·½°¸£¬±¾Õ¾µÄÌû×Ó¾²Ì¬»¯·½°¸½«½è¼øÕâÆªÌû×ÓÖз½·¨¡£Ïòhttp://www.agilejava.orgµÄsingleµÄ¹²Ïí¾«ÉñÖ¾´¡£
תÌûÕýÎÄ£º
ÏàÐźܶàÈ˶¼Ï£Íû×Ô¼ºµÄÒ³ÃæÔ½¿ìÔ½ºÃ£¬×îºÃÊ ......
public static void main(String[] args) throws ParseException {
String str = "yyyy-MM-dd 00:00:00.0";
String str1 = str.substring(0, 10);
/*
* ½«yyyy-1-1ת»»³Éyyyy-01-01
*/
SimpleDateFormat sdf = new SimpleDateForma ......
ÔڲμÓJavaÅàѵµÚÒ»Ììºó£¬×Ô¼ººÜÓиÐÏ룬ÔÒòÆäʵҲºÜ¼òµ¥¡£±¾ÈËרҵÊÇÈí¼þ¹¤³Ì£¬ÏÖÔÚÒѾ´óÈýÁË£¬ÎªÁË×Ô¼ºÒÔºó¸üºÃµÄ¾ÍÒµ£¬²Î¼ÓÁËÕâ¸öΪÆÚËĸöÔµÄJavaÅàѵ°à£¬µ«ÊÇÔÚÕâ¸öÈËÊýΪ60ÉÏϵİàÖУ¬Ö»ÓÐ5¸öÈËÊǼÆËã»úרҵµÄ£¨°üÀ¨±¾ÈË×Ô¼º£©¡£ÆäÓàµÄѧÉúÊÇÊýÀíϵµÄ¡£
......
ÓÃJavaдµÄ¼ÆËãÆ÷
package com.wenbo.myprogrem.day15;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.Actio ......