jspÖÐʹÓÃEXCEL×é¼þ½«±í¸ñµ¼³öΪEXCELÎļþ
´ËÖÖ·½·¨Ê¹ÓÃexcelµÄ×é¼þ£¬ÒªÇó¿Í»§¶Ë±ØÐë×°ÓÐexcel³ÌÐò¡£·½·¨Êǽ«±í¸ñÖеÄÿ¸ötd±êÇ©µÄÄÚÈÝÈ¡³ö£¬×÷ΪexcelÎļþÖÐÒ»¸öµ¥Ôª¸ñµÄÄÚÈÝ¡£
1¡¢ÔÚÍøÒ³ÖÐÌí¼Ójava½Å±¾
function AutomateExcel(tableid,unusecolumn)
{
// »ñÈ¡excel×é¼þ
var oXL = new ActiveXObject("Excel.Application");
//´´½¨¹¤×÷±¡
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var table = document.getElementById(tableid);
var hang = table.rows.length;
var lie = table.rows(0).cells.length;
for (i=0;i<hang;i++)
{
for (j=0;j<lie-unusecolumn;j++)
{
oSheet.Cells(i+1,j+1).value = table.rows(i).cells(j).innerText;
}
}
oXL.Visible = true;
oXL.UserControl = true;
}
2¡¢Ôö¼Óµ¼³ö°´Å¥
<input class="Noprint" type="Button" onclick="AutomateExcel('ordertable','0');" value="µ¼³ö">
AutomateExcelº¯ÊýµÄµÚÒ»¸ö²ÎÊýÊÇÒªµ¼³öµÄ±í¸ñµÄID£¬µÚ¶þ¸ö²ÎÊý±íʾµ¼³öʱ±í¸ñĩβҪºöÂÔµÄÁÐÊý£¬Èç²»ÐèÒªºöÂÔ£¬ÇëÉèÖÃΪ‘0’
3¡¢OK£¡
Ïà¹ØÎĵµ£º
<%
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
List stafflist = ((StaffDAO)ctx.getBean("StaffDAO")).findAll();
request.setAttribute("stafflist",stafflist);
%> ......
JAVA×ÛºÏÃæÊÔÌ⣺ҳÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³Ãæչʾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ã棬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......
JspÁ¬½ÓMSSQL2000µÄÁ½ÖÖ·½·¨
×î½üÔÚѧϰJSPWeb£¨Tomcat·þÎñÆ÷£©Ó¦Óÿª·¢ºÍ»ùÓÚWeblogicºÍMyelcipseµÄJEE5µÄ¿ª·¢£¬ÔÚѧϰ¹ý³ÌÖÐÉæ¼°µ½Á¬½ÓSQL 2000 Êý¾Ý¿âʱ£¬ÓÉÓÚÈí¼þ»·¾³µÄ²îÒìÐÔºÍһЩ°æ±¾ÎÊÌ⣬»¨Á˺ô󹦷ò²ÅÁ¬ÉÏ£¬ËùÒÔÔÚ´Ë×÷¸ö×ܽᣬϣÍûÄܸø´ó¼ÒһЩ°ïÖú£¬²»ÒªÔÚ»ù±¾µÄ¶«Î÷ÉÏ»¨·ÑÌ«¶àµÄʱ¼ä¡£
·½·¨Ò»£ºÀûÓÃSQL Se ......
·ÖÁ½ÖÖ£º
Get·½Ê½´«µÝÊý¾Ý½â¾ö°ì·¨£º
<%
String username = request.getParameter("username");
byte[] bytes = username.getBytes("iso-8859-1");
String result = new String(bytes, "gb2312");
out.print(result);
%>
Post·½Ê½½â¾ö°ì·¨£ºrequest.setCharacterEncoding("gb2312");
......
×Ô¼º·ÖÒ³£¬ÏÂһƪ»á½éÉÜʹÓÃdiasplaytag×é¼þ¡£
ʹÓÃmysql5, ÓиöÊý¾Ý±íuser,×Ö¶ÎÓÐid, username, password¡£
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional// ......