该用户从未签到
|
新人报道,顺便问一下怎么样在让下面这个页面的数据能导出到excel表# M( e- Y2 v% k) q: m$ }
# U% T* v7 d# f. v
& g3 C. I0 Z3 s8 j: p6 _& J
7 c9 e8 L$ b, Z! }" m" b9 u! S代码如下:
5 _# b( j7 \3 _8 b9 l# N
5 `- I& `( O2 i9 i$ k<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>7 L$ ~7 o6 M4 {+ l; {
<%
* O9 l5 h$ J- k# E) q* [' [1 \- B) @ String path = request.getContextPath();
. |% d" ]3 W1 D- r4 H L& i- n& t String basePath = request.getScheme() + "://"6 c- Z. t/ {& x/ {
+ request.getServerName() + ":" + request.getServerPort()
" [2 T) x( q: F3 h L [0 K: z + path + "/";, A% t/ M7 `3 G; l5 q. `! A4 i
%>
# _+ I) n% R% q" X<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>. i4 N3 p: t5 d2 s
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 |9 ?0 R d Y2 A5 X; l1 _<html>* c9 P* }, x5 F, R3 D# f
<head>- M2 j' P4 m4 o8 Q
<base href="<%=basePath%>">
9 `$ n b# z8 f; S, m: x0 s9 d2 g- k7 {2 v+ G; {8 l9 {
<title>采购信息</title>
% F) }+ w6 Q* [, N2 k* a$ S, O9 p+ ~
<meta http-equiv="pragma" content="no-cache">& J% B: ^+ f* [5 i
<meta http-equiv="cache-control" content="no-cache">$ f, A5 G7 U. a, i
<meta http-equiv="expires" content="0">
4 g/ Z2 l( a0 t <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
9 G3 r, F3 H1 ?, z <meta http-equiv="description" content="This is my page">
/ }8 Y. }: @3 o) I! ? <!--$ U9 W n4 v+ O
<link rel="stylesheet" type="text/css" href="styles.css">: }. [. p- W0 A. @# w1 O2 g' @
-->
3 X7 n8 K: h6 Q% \5 J4 z& Q5 t3 S" A; a9 h2 V2 c
</head>
- Q4 f- F( V4 o8 ]& J: L <script language="javascript" type="text/javascript" src="<%=path %>/My97DatePicker/WdatePicker.js" defer="defer" >
6 v7 M) W1 ?$ O/ @0 U4 A</script>
! X* ` L$ v: X; @! [ <script type="text/javascript">- ~! ], g9 B, V8 H7 g& P
//添加按钮
1 ~3 D) R0 J; K+ c function add(){
6 P4 @5 U/ O/ L) Z5 p9 B" r document.thisForm.action="buyadd.jsp";
/ e1 U' s5 V# ^, V* H7 Q document.thisForm.submit();% K5 E/ d7 d$ z* Y" P1 M
}
, o# V1 e/ S" W/ | //修改按钮
% P0 w: x- {. p- d" z function change(id){
# x+ l' Z0 a+ _& Y# b document.thisForm.action="OrderServlet?method=queryByid&flag=0&id="+id;
: Q% e, o: B+ v8 `" { q, \! T) k) y document.thisForm.submit();
, ?$ e" O1 L" U4 F2 `3 u }//查询按钮 n4 I& M7 C. V+ E# u
//function query() {
8 V2 T! X; |; p) |3 [' d/ f8 s //var oid = document.thisForm.oid.value;9 x* o& N% z3 u: w8 d
//var gname = document.thisForm.gname.value;
' U8 c: ~7 w1 | //document.thisForm.action="OrderServlet?method=queryid&flag=0&id="+oid+"&name="+gname;
6 J, G4 }( e- Y5 ]5 w4 V" V/ D //document.thisForm.submit();* Y/ L0 h ]* k, F) ?) {* i
//}4 T* N1 ?; G7 Q9 ^4 U Z4 H6 q
function search(){5 _8 Q" j' R# G, y- b0 @* ~# z
document.thisForm.action="ProfitServlet?method=queryList";( k: b/ z$ R& X" Z
document.thisForm.submit();. H2 t: S8 O# `, ?
}
) l+ z+ G% B* S" s </script>
$ g, A/ K8 o: p0 Z- @ h% f <body>, J5 q: ]4 |' ]; i, t" X7 F q N
<form action="" method="post" name="thisForm">: U5 ~; N% |, A# G; l4 @5 Y) F
<table width="100%" border="0" cellspacing="0" cellpadding="0">
9 S. z; [0 G5 K K <tr>6 p6 y" I+ h/ z! i: A6 O& C' k
<td>
0 G1 B( ~& K% ~! Q3 s4 m$ r <table width="100%" border="0" cellpadding="0" cellspacing="1"
/ F' C# U) b8 F O3 `( y; B* l/ ?3 h7 @ bgcolor="#c5dbed">6 X( I2 q8 q. ^& l
<tr>6 @% i0 R r8 K! C) a, a0 m
<th height="29" background="images/bg_MainTable.jpg">4 ]: w4 e, d& N
<!--主表格标题 开始-->
) I- C" i4 R9 O. X4 N. E <table width="100%" border="0" cellspacing="0" cellpadding="0"> K& b5 n( t( _: h$ a4 t
<tr>
2 g z0 ~, k* X# n. }; ? <th align="left" class="STYLE1">/ q/ ^ e/ C; {, L# I, N& o
采购信息查询
& E* J8 g8 Y0 |; S2 w2 l </th>
/ F# I [& n. |0 G4 W7 \ <th width="57" align="left">
) p! e/ x* ~; j w% e
- m& G& y; @' d" N6 f; F </th>! `" |3 l* M9 Z$ P) O
</tr>1 ?8 p8 R) w4 A d0 O
</table>( K# o8 M1 W0 m9 J- ]( T }
</th>
) N$ @3 M, ]/ s </tr>- `! a: `0 k1 g$ K: w+ @- y
<tr>! u/ s' n/ y) d. _- Z$ Y
<td align="center" valign="top" bgcolor="#FFFFFF">5 p) r& l8 y7 ^) `! ?7 w0 r
<table width="100%" border="0" cellspacing="0" cellpadding="5">7 h* O% N: V" d! ?
<tr>
" j) h( |8 L5 M4 ^: K8 V, v0 G <td>
3 \% A1 O: e7 e3 [* ]- Y( f% I: Q- H <table width="90%" border="0" cellspacing="0"
( j3 k6 U- w; Y( i5 }7 W, ] cellpadding="5">
9 _: |5 r4 h7 F <tr>- V9 O( t7 v; \
<td align="left">; z& _' Y+ f' \7 k) @ g& S
采购编号:
5 f3 w: P% V- t% Z0 c <input type="text" class="inputbox_01"6 \" K- S" T, M- S( F6 z
style="width: 100px" name="oid" />6 h, p) c9 b" H, i5 |% Q
</td>
, \" B& R8 w& ^: k( ^$ y$ f <td align="left">
$ I# p; j% n' l" H/ a 商品名称:
6 Z9 r+ K) G) H5 }" | <input type="text" class="inputbox_01"
9 _/ X8 L: ?% i& | style="width: 100px" name="gname" />
: k2 C4 c: U2 F# H5 Q </td>! O; e( l" b$ p( N5 h
<td align="left">
( |9 }) F% H) B" _5 b 采购日期:
6 _8 w1 q1 |3 p6 K- C& D- e! D <input type="text" class="inputbox_01" style="width: 120px" name="starttime" value="${ticketInfo.datetime}" />6 @' f& f" u1 |+ L8 `
至
' m# \3 N$ q5 ^7 Q; X1 } <input type="text" class="inputbox_01" style="width: 120px" name="endtime" value="${ticketInfo.datetime}"/>1 |- t" A9 A8 f
' ~ ^* r# i5 y </td>7 g4 O2 i' _+ m* T9 m6 R
<td width="10%" align="right">
7 ], M; U# H* L/ F. x <input type="button" name="button" id="button" value="查询"5 S2 Y) i* ~; h3 Y! a
class="btn_01" />9 t/ e; y2 b0 S: h; G$ m# w
</td>0 `, P# \9 G- T8 K! o
<td width="10%" align="right">0 ^1 w; H3 Y) i: u* ~4 H
<input type="button" name="button" id="button" value="添加"2 M- \. H7 V! W! }
class="btn_01" />
! F- F5 R$ h* G0 M </td>
5 M ~# }" }+ h: Z# \2 _- P </tr>1 F! }% I' G: O
</table>
- S3 r' ]2 i! g# M" t <!--查询区域 结束 -->/ }) x8 G, M. D4 L5 T
</table>1 |/ V9 Z3 O1 Z& U n
1 f; ?% t( `* F0 {) a
</td>* @5 |1 [! T/ x. e- k9 W. e3 i
</tr>7 L: K/ U) g! X4 K+ l' P& t* ]! E
, z2 I- y2 k9 ~$ T" ^+ u4 M, i
<tr>& S& i. \8 g1 J" x
<td height="88" bgcolor="#FFFFFF">
+ }- a" V+ Y4 d, ~3 j9 d- I" [ <table width="100%" border="1" cellpadding="0" cellspacing="0">
/ J' }+ J/ G. ]4 ~2 s0 ] <!--子表格标题 开始 -->; K. t% P# L5 {7 M, B% ~, b
<tr>
& N: H8 Q) R' q% W <th width="8%" height="23" background="images/bg_MainTh.jpg"' y4 j: e3 _# l, T
class="color_254374">
* \* r" i7 X# E, ] 采购编号, g! N& @7 X9 b
</th>1 A4 b8 V' y. H3 b' E _6 H
<th width="8%" height="23" background="images/bg_MainTh.jpg"# l5 @4 x" m! m& r# g7 X' Q
class="color_254374">9 T$ M2 ~8 T' j
商品名称: F9 [& l9 p. b( \* _4 p$ Y
</th>: P/ s& A' j& b( M# g
<th width="8%" height="23" background="images/bg_MainTh.jpg"6 y2 r- [ [/ F% G& l
class="color_254374">
. B j# j0 b1 n' }- ~' P 采购人员' h0 j0 l8 H& B; E7 }$ |# x
</th>
0 E6 p) W& m9 ^5 T! y. p <th width="8%" background="images/bg_MainTh.jpg"
0 n! |, |7 P9 n- I class="color_254374">
4 c! N, O6 | V% a7 k 采购数量" ?* O1 g: y6 l" f& o1 C
</th>
& U0 z. X- T! S+ ^9 [$ V <th width="8%" background="images/bg_MainTh.jpg"1 b4 V! u, g8 ~4 u: O3 s
class="color_254374">) ~( g! H3 g* W9 w: L- H5 z
采购价格1 ?# _/ R* F$ d5 x% q1 Y
</th>2 D7 x( z, }6 r# Z' ]# `7 V
<th width="8%" background="images/bg_MainTh.jpg"7 }1 V' @' D' i3 P1 _5 c# h$ @
class="color_254374">
! T2 Z7 t/ t! L( f# C4 Z: H7 J 采购日期2 K+ A- q6 a* c3 O5 z. g
</th>2 L# b6 A& I# \3 d* i" g
<th width="8%" background="images/bg_MainTh.jpg") _% k! O. A* q( l/ W
class="color_254374">
+ y$ \6 T5 {+ f' f8 p 操作
$ m; L: G+ M2 z, T n </th># r3 l A# a' n5 U5 ]
</tr>
6 L" g- a) d7 G; \& I2 M <!--子表格标题 结束 -->
2 C# K+ S$ F, K5 g V0 m- ] <!--子表格列表 开始 -->0 m, J9 G! \. S/ {: A5 S
<c:forEach var="map" items="${list}">
0 y$ B \6 p4 u- ]; k: k+ S <tr>
! j9 s: P* f' k <td align="center">
4 }( V2 J! Q& \0 X9 | ${map.o_id }# g3 R" o4 E0 v) f
</td>! r- ?2 H; R: o# w& J# s
<td height="24" align="center">! M. k7 Y6 y# f% X4 }2 t5 `5 f( l0 o
${map.g_name } H8 P( M) N8 u/ w# F
</td>
: x, F3 z( A( ^# {7 e <td height="24" align="center">
8 x5 h! q% p7 _8 P1 ~6 Y' M ${map.p_name }
9 Z1 Y! ~1 p6 L' v/ n% g( v# k </td>
/ N; c, \6 \2 h <td height="24" align="center">
$ N! Q, w" |9 n$ O ${map.o_count }
8 G7 ^& P7 R6 o+ @9 Z9 \! V" ?$ j* d </td>5 i# e& ^: f0 ^4 `/ @
<td height="24" align="center">
0 B' I7 @# {3 T2 |# q, F1 `% o! @2 F ${map.o_price }/ e8 b) q8 M3 ~+ u4 ?# _" K
</td>
K- w) Z$ @1 G ~6 T8 q3 X' L <td height="24" align="center"> \; }* M; x+ `2 j5 E
${map.o_date }
/ H3 F. A) o) Q# N5 F7 m5 A" } </td>* l- ]* `, N) _. f9 a7 t3 z
<td align="center">' ?; n) g: ?+ [0 Y+ X
<input type="button" name="button" id="button" value="修改" v6 j/ u2 T9 f9 E! E& j
class="btn_02" />
: V5 w1 d4 I+ [4 } </td>, l0 Y- L* d9 z1 ], s& y; {
</tr>
7 E! `& q7 g% @% S9 \4 ?, n$ L </c:forEach>, P5 P0 {3 {7 G0 Y, d
</table>
0 p6 h0 t' i* Z/ |) q7 q" V1 m9 [) v <!--子表格列表 结束 -->
, i* ^; u0 h f4 J; A </td>; Q; R# O; @, p# ]. g
</tr>7 C; p3 a6 [4 U9 F- u6 B* v
</table>( C) s& b, z4 [3 Q8 R' R- P
7 E k% I' Q2 a
<table>
' m3 I( J5 Z3 L. l" @, @: p. [ <tr>
* I9 m% l* v$ z0 o( e <td align="center">
" P# R S5 k6 V2 G 当前第${requestScope.pageNo}页,共${requestScope.totalPage}页6 ^7 Z- V2 ], H! ]+ n5 |9 w
</td>/ x( Y2 F5 R" I2 S
<c:if test="${fg==0}">- N$ w5 d2 d+ V
<td align="center">6 k6 Y$ d( S, q# h, j1 I1 ^# }
<a href="OrderServlet?method=query&flag=0&pageNo=1">首页</a>3 b! g, M. L. Y7 D8 T6 M
</td>
: p9 P4 W, e* _1 U <td align="center">0 @8 O$ b1 `( n- j
<c:if test="${requestScope.pageNo>1}">
" t- h) j- C/ z) D" ?: S <a
. U6 C7 C5 Z$ ?8 C' l% a href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo-1}">上一页</a>
* Z+ C( |7 d1 H) u% \+ @ </c:if>
) H1 ?+ j- ^) N3 z# |/ K </td>
) F1 N. p L! @+ k+ j. r# e <td align="center">
2 [5 ~( h+ F: K# F2 x <c:if test="${requestScope.pageNo<requestScope.totalPage}"># I7 [* s. ?# u/ Z7 d; O) z. y3 d
<a
2 n6 F O# N% f' k9 |: D4 b9 r% B3 ? href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo+1}">下一页</a>
8 h- x7 B) s) V3 ]3 M0 {, e </c:if>
" |2 I( f |$ x+ v) a) ` </td>3 a) ~3 w. [7 O* Q% f. {
<td align="center">
! ]% u, B( W; ^9 ] H$ c! D% g <a2 o' S" l, n/ F% J: [
href="OrderServlet?method=query&flag=0&pageNo=${requestScope.totalPage}">尾页</a>1 f- L( E8 u Y4 W4 v
</td>& t9 ?' @) T# U. h- c
</c:if>. T! ?3 y1 W$ p8 v6 ~1 A5 Z
</tr>
% F0 V7 K9 e8 G+ c( } </table>
0 F# s2 \7 R Y4 W9 r1 F: O) c </table>7 }% z* J. l( s( t5 x( }- y
</body>
4 X' }1 u, V) ]8 @* J4 c</html>
: z& ~- v9 _5 N2 C T+ S( y2 H5 _. s/ M/ u# }) j1 G
* R) O% b2 L0 ?$ |
|
|