该用户从未签到
|
新人报道,顺便问一下怎么样在让下面这个页面的数据能导出到excel表! q) z3 p7 K. S0 v$ A4 \
) p% z( L) ^, }% Z- H
: r( b$ F; u, q5 j& ^* ?# y
# d: k, a9 p+ n1 X2 ]+ b* A+ _代码如下:
6 o9 C. o9 N$ X: y: H6 ^7 y* ^, K6 C# }! V
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
/ E' v$ [2 p8 x<%
/ r m9 C1 [9 y: w1 b" {8 x$ T String path = request.getContextPath();
. v4 N' B, v3 P; [6 T4 H String basePath = request.getScheme() + "://"# B0 J* v+ d* Q0 f9 O; a
+ request.getServerName() + ":" + request.getServerPort()0 c+ B' P& w$ l# s- _1 Y. |
+ path + "/";
& m1 r: \& n0 m3 ]3 c5 X( M%>
p2 r9 `4 I/ F- T0 b: e3 B; |<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>3 |% t. w& k& ^
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" X g$ l/ V' ~ i4 u
<html>) G8 V' F1 L: Y- y+ c# [: ?) ?, M
<head>& B& Q* K# {8 ]7 K h) _
<base href="<%=basePath%>">
8 L3 a# A/ J% T4 Z! G, Z8 u8 C, l3 O# o5 ~
<title>采购信息</title>+ h$ v4 [/ u. m9 U* Z' T
5 w& m# H) o' j, T' ^1 t% p: M <meta http-equiv="pragma" content="no-cache">0 K. M/ f0 ^2 ?; f9 D
<meta http-equiv="cache-control" content="no-cache">, S7 F% d% e9 l1 X
<meta http-equiv="expires" content="0">
" S7 j7 W5 ]$ n' P V' M <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">" c5 [2 X: ~( ~6 `
<meta http-equiv="description" content="This is my page">+ F/ H- M. H1 u
<!--3 ? q5 ` Q; }" g
<link rel="stylesheet" type="text/css" href="styles.css">3 C! V- D! t. v( l
-->* ~* C1 z3 a- N" J; L$ J
7 |. a0 o- a8 l! P1 b/ a
</head>; Q$ r8 B5 i& z
<script language="javascript" type="text/javascript" src="<%=path %>/My97DatePicker/WdatePicker.js" defer="defer" >
# r7 T6 u" ]0 w; o</script>- b+ O2 l& f1 D6 l6 V# p7 T- l7 \
<script type="text/javascript">' {8 x* P* H( k$ |) S6 O4 Y, ^
//添加按钮# A. Q( J. H4 P+ e2 J4 W
function add(){/ \# W; X* C, Q7 S
document.thisForm.action="buyadd.jsp";
8 h9 p. U" l3 }5 r9 h document.thisForm.submit();
% _5 T7 t. |. A/ L! @& c }
/ @. S( B, }& e8 U1 K //修改按钮6 v: C( y; |4 W- t
function change(id){
" o3 u- o8 X e6 Z document.thisForm.action="OrderServlet?method=queryByid&flag=0&id="+id;
6 C+ S5 a& |% M: g document.thisForm.submit();; T. k( Y2 t3 }+ P9 m
}//查询按钮/ z a" j' |/ i$ }
//function query() {# J% X" D; W$ S
//var oid = document.thisForm.oid.value;" S% \/ ~: N" R3 }' _$ A& c
//var gname = document.thisForm.gname.value;
; t3 b4 j4 e. h# \. S# ~8 i //document.thisForm.action="OrderServlet?method=queryid&flag=0&id="+oid+"&name="+gname;/ j0 c2 |, ~) G) h
//document.thisForm.submit();
5 m2 T; }/ a( z0 c //}
9 Y! {9 E& p+ Z6 C2 @7 {. |. } { function search(){; y% W7 t( ^% [2 g3 c
document.thisForm.action="ProfitServlet?method=queryList";
7 P' [2 v" L2 c* L' n( Z M* q6 E document.thisForm.submit();
( \( r9 H. R9 V0 k6 o }, a( u, S# E9 e: Q9 c$ Y
</script>+ u8 V; o3 G0 F: [ h+ _/ s7 Q K
<body>
( k+ t0 U; r( j6 S <form action="" method="post" name="thisForm">
" H/ n( g" c1 w. ^5 u <table width="100%" border="0" cellspacing="0" cellpadding="0">1 R: u4 R1 b# x9 ~! F2 t0 q& W
<tr>
# r: O( r4 _! M( t8 \, w, ]6 o <td>; [/ @: [5 [# J: Z1 H
<table width="100%" border="0" cellpadding="0" cellspacing="1"2 a/ e" m2 c" W4 ~7 w( N
bgcolor="#c5dbed">
9 A8 W* e. W0 i& v1 R# d <tr>
; ~" M/ e7 }; p& x9 N1 @ <th height="29" background="images/bg_MainTable.jpg">
* C$ z: V' U' y1 N <!--主表格标题 开始-->
" s6 x( X6 y, ~& A <table width="100%" border="0" cellspacing="0" cellpadding="0">( n# ]- _( I7 v- `5 Q7 Q" B
<tr>6 N5 Q! k0 T* j- W- Z
<th align="left" class="STYLE1">* J8 I) L' O0 m5 {- b8 h! Z
采购信息查询
% p, r; T o- l5 O0 ~4 u' E </th>
, g$ O+ r/ U! m) { <th width="57" align="left">
) w/ v! S/ ^, Y . |* t+ n# j( ?' t; p6 F
</th>
* }3 I0 w7 ?* k9 g- J% W0 I </tr>
1 [9 t6 q2 i& n5 A0 B4 d </table>
8 w- ]* ` j$ k# K </th>/ B+ U3 Q0 g3 x9 d
</tr> e; |* e* h/ u3 `$ T' z+ Z
<tr>
& G' V g5 ]) `! x <td align="center" valign="top" bgcolor="#FFFFFF">: F8 s, h& F' a" z8 J
<table width="100%" border="0" cellspacing="0" cellpadding="5">
- C' e, V0 [# z s' p% d <tr>
: t+ Q% G' Z+ x! | <td>. Y. L- d7 f& o
<table width="90%" border="0" cellspacing="0"+ N1 [7 t! n* S8 e6 K1 n7 W
cellpadding="5">, i2 H# N3 d8 o& t
<tr>2 \1 i$ |, |( q6 S9 O
<td align="left">
( ~6 M- n& u# o( T# A8 f 采购编号:
1 [+ Z2 U9 n2 w: { <input type="text" class="inputbox_01"
% p$ I: |. v- |/ |% ` style="width: 100px" name="oid" />2 H2 y/ `; w1 F: ~% B" X" B, Y0 Z
</td>1 N9 {! G: R$ m* S6 J
<td align="left">6 m* x% n, S1 @7 t" f1 `* w6 L% k
商品名称:
$ K8 s2 ?9 _7 t7 H D <input type="text" class="inputbox_01"8 t/ z" U+ _2 X. J& m
style="width: 100px" name="gname" />4 z2 l) s0 [/ A& r
</td>3 x& p) z$ }9 @: N9 e U
<td align="left">
+ m! [4 B/ f$ J 采购日期:* e t0 F) v' L
<input type="text" class="inputbox_01" style="width: 120px" name="starttime" value="${ticketInfo.datetime}" />4 C- b6 z) O6 b" V
至
6 H* h$ p& K# Z <input type="text" class="inputbox_01" style="width: 120px" name="endtime" value="${ticketInfo.datetime}"/>; g3 J- r! [& D5 T5 x
% v' Q9 C- I' y9 s& E u6 B, \ </td>
% z) y% r0 ?+ s) [, ^; r0 p <td width="10%" align="right">5 C/ `/ G" r8 H
<input type="button" name="button" id="button" value="查询"# x# Z# s# l5 ^) s2 n
class="btn_01" />
9 a3 D0 |, \+ h! k: @5 Q </td>2 q: p* {! G1 r5 U" R( g( m
<td width="10%" align="right">1 \( [* R- ^: h$ y
<input type="button" name="button" id="button" value="添加"+ ]' [: c0 s% Q
class="btn_01" />
/ h1 l( [8 L. w8 ~2 O* R </td>
; _& j* T7 _6 f" f8 L4 [1 V5 Z </tr>- T$ }: ]7 |% e9 Q0 x
</table>- y2 Y: V: j9 U
<!--查询区域 结束 -->2 ~% @: u( E1 d5 w+ E+ q$ m
</table>
* j$ l8 J* J6 Q% \ p1 [
9 Z% g6 C. ~9 h" [. J0 a/ |, Z </td>
, g3 ~4 D- [( {) Z# {4 F </tr>
5 X* C0 c6 y: z) A7 j0 b E: H9 S3 z8 h% K
<tr>
+ }- n2 {8 o8 z$ c) w <td height="88" bgcolor="#FFFFFF">. |( ^7 ~% b+ |+ \+ a; N
<table width="100%" border="1" cellpadding="0" cellspacing="0">
2 w" }( d' P: j" o! ^ <!--子表格标题 开始 -->
5 \; s- a% s. S% M: z& F <tr>
7 j5 W% M) D$ J* S# t$ E8 |* K' T <th width="8%" height="23" background="images/bg_MainTh.jpg"$ w+ M, g0 d4 s, x$ F0 `: J
class="color_254374">: |3 Z& \0 Y5 D0 Q: F9 r2 J B: n
采购编号# y9 s* h. G f7 [% X
</th>
, [8 u* Y- G* i3 v" P% z: P <th width="8%" height="23" background="images/bg_MainTh.jpg"! X9 q: ]; z2 M( c5 C3 j
class="color_254374">
) }% R# J2 e2 b 商品名称
% D U3 m! E6 W- U( C. o; z </th>
$ s# [$ D4 E. Q2 J. @; Z, J. E8 Z6 O <th width="8%" height="23" background="images/bg_MainTh.jpg"
( m- y5 F2 H9 z class="color_254374">6 B1 E3 a) y1 W) Q
采购人员
& o& a% F0 [: z: c+ A, p </th>6 Z3 h& G& Z1 x4 ?
<th width="8%" background="images/bg_MainTh.jpg"5 m. E; l1 R, D, P0 N4 f- C
class="color_254374">
) h4 h* i. q: n* f 采购数量
- n- f; T; ^# N </th>/ W6 ` H2 b# J! P$ f
<th width="8%" background="images/bg_MainTh.jpg"
+ d, x3 Q+ ~& f/ Z* f/ r class="color_254374">
7 P( A" |' P1 |3 n, _. J! q$ k 采购价格
3 X# H; Z2 f4 h5 e" f$ ] </th>7 @- w* y. e6 _1 J( M, |
<th width="8%" background="images/bg_MainTh.jpg"
+ k% p% H/ F4 x4 j% L8 k8 M" x class="color_254374">
6 a6 {, d8 d+ q5 V6 N 采购日期1 X7 [/ ?2 U* l) r
</th>$ V5 L: |- q3 R, b
<th width="8%" background="images/bg_MainTh.jpg"' V" d# h. y |9 q; e
class="color_254374">
9 ^9 M' Z% c) A% S. {& |+ \ 操作 i8 v. y3 a- x
</th>
; d: K e! b3 n. v" o </tr> `' ^5 L7 [# U* b" _' Z4 \$ I
<!--子表格标题 结束 -->5 a' R8 F- B4 G6 w3 u; c
<!--子表格列表 开始 -->
/ C; m7 p& }' F9 Z0 q0 p0 l <c:forEach var="map" items="${list}">
' F' r6 j: e& b/ |7 o8 w, F& O* E <tr>' d4 z. s4 c! }% T0 i
<td align="center">0 y7 e" P9 Q6 Y$ g8 W3 g; b+ V
${map.o_id }
H4 i" Q% q3 b o2 }) ~3 [ </td>6 F* U4 m- R; M4 C n% u( x3 J, B
<td height="24" align="center">
3 Y, D T' }7 |& E, U3 ?( i ${map.g_name }# Y6 B7 k6 Z6 W6 Q# i" \
</td># E; ]: \5 k( {% k6 l+ ^
<td height="24" align="center">
$ s& c5 d. ?- q, w, u ${map.p_name }
+ Q6 `" u7 E* S- ^7 | </td>, ^9 Y) k2 I2 ]3 r5 r r |) Y8 G, ^
<td height="24" align="center">" c8 _, F1 u' P2 @( Y2 q
${map.o_count }
& y8 u: W7 i! _! k/ M </td>
% y8 v3 T0 s- M <td height="24" align="center">
* l0 \3 ^. w: @2 v) x5 v7 f4 U$ Y ${map.o_price }
* \4 @/ q% a' C L2 t </td> ]: n7 f0 w$ t- w) w8 D" O
<td height="24" align="center">) X0 Y" k9 u% ^/ d& [/ p9 d
${map.o_date }$ L+ E& J5 a }9 `9 |
</td>
% B9 P% \1 s/ a7 W <td align="center">
, J" J K) X# e* \' w1 R6 n <input type="button" name="button" id="button" value="修改"
7 Q# A- ]/ }2 _6 I# R& |2 A. g class="btn_02" />* }% q# j! L8 L
</td>
9 k) E% H4 S4 x8 h </tr>
3 r6 B, I; J. K. `$ W h+ d% B </c:forEach>
7 ?% t$ z2 }6 P6 E6 [; j- _ </table>
8 J5 s6 k0 t% u8 M8 g1 }& o; x# C <!--子表格列表 结束 -->
/ m5 J' c4 i0 F </td>. q$ k# j8 W7 @5 v7 Z' V1 e
</tr>$ x' x- D8 A( u. l
</table>: ]1 o# D s( Z* f7 x7 ~5 r
+ _6 o9 V! y0 o0 Y1 i+ ^ <table>( E( N+ N) b3 H' u: L8 ?
<tr>
8 h+ M9 B1 m5 k( s7 ~- p2 A <td align="center"> `6 {7 i7 p6 u8 Z
当前第${requestScope.pageNo}页,共${requestScope.totalPage}页3 x& M8 t% j; K$ B8 S5 b3 W
</td>
' n8 I. K# H9 I <c:if test="${fg==0}">
! Z0 c" g6 |0 c' d8 G$ X. S <td align="center">
9 N1 a, p& S0 p* U9 [4 P <a href="OrderServlet?method=query&flag=0&pageNo=1">首页</a>
' e6 f3 Y7 a `1 Q6 U) ? </td>+ g) }& k5 z; J! ?0 a T
<td align="center">9 x: Y# o& y3 _7 f9 N
<c:if test="${requestScope.pageNo>1}">
) T0 D- K+ D+ x& G. Q$ o* m+ Z( { <a
3 a x7 w! K4 u: R href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo-1}">上一页</a>
1 t2 U/ |% j8 ^* _9 w8 o' h! v8 _ </c:if> `( p7 A+ ?) j, D2 O5 O
</td>
$ }4 \6 _! y Z: x, E <td align="center">6 f& I* _% k- Z. M/ R
<c:if test="${requestScope.pageNo<requestScope.totalPage}">
6 j2 {! X( F: _8 u7 P( P8 g* |8 g <a j0 g. L9 i- `" ~2 A
href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo+1}">下一页</a>1 j, ^ s. G" L F
</c:if>
& B( z8 s- M( u' W1 D6 {' @ </td>
% T0 t3 G) X5 i# Q( a+ } <td align="center">' b |' d# g7 b0 W# n/ k
<a
B, S f0 @7 }" {! y5 q# V& K href="OrderServlet?method=query&flag=0&pageNo=${requestScope.totalPage}">尾页</a>1 H9 l4 D9 H o" k! b8 {
</td>
* ~! e5 g" P$ M5 \+ K4 p </c:if>5 V& g/ q' N1 U9 B4 v- {/ F
</tr>
3 ~- {( O) j; y </table>6 j' R8 G) w1 D3 Z# z4 }4 u
</table>* H8 {1 [6 i/ Q( a: m0 _ R6 C) |7 C5 Y- ^* U
</body>
1 r, c. M: h" R6 P</html>* z p& l+ W* f* t2 |9 y
5 K* ]/ @! \8 k
; b6 y6 P1 s6 [2 K' y( [ |
|