andy_taoke
大家一起来学JAVA
posts - 9,comments - 3,trackbacks - 0
我还没有找到具体的例子,不知道哪位达人知道~~~
posted on 2005-12-20 22:27 Fusion KISS 阅读(1097) 评论(2)  编辑  收藏

FeedBack:
# re: 谁知道怎么用JSP生成一个office(word、excel)文档?
2005-12-27 16:08 | Cisco@JAVA
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/** Servlet that creates Excel spreadsheet comparing
* apples and oranges.
*/

public class ApplesAndOranges extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("application/vnd.ms-excel");
PrintWriter out = response.getWriter();
out.println("\tQ1\tQ2\tQ3\tQ4\tTotal");
out.println("Apples\t78\t87\t92\t29\t=SUM(B2:E2)");
out.println("Oranges\t77\t86\t93\t30\t=SUM(B3:E3)");
}
}  回复  更多评论
  
# re: 谁知道怎么用JSP生成一个office(word、excel)文档?
2006-01-12 12:41 | atian
jxl
pio  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: