该用户从未签到
|
新人报道,顺便问一下怎么样在让下面这个页面的数据能导出到excel表/ C7 }0 D! @$ R" l% _! T$ D
4 p P! |9 p5 l' y) |+ e- S$ ?: k1 Q( J* \# w
* V" g, R o( E5 P8 |
代码如下:
: D: C& L$ n) X0 c
: m9 ?% Q: m: x' i6 n<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
$ ^# ~: ?$ z' m$ t; @<%
0 {, |+ _4 n* k$ w3 G0 F* d2 _ String path = request.getContextPath(); K' K& a# Q; o
String basePath = request.getScheme() + "://"
; i0 E) X1 [( ]6 \ + request.getServerName() + ":" + request.getServerPort()9 A' r* m( b1 @) p; |0 H
+ path + "/";/ L3 Z) @9 Z9 z/ ]
%>/ ~9 X$ O* V- y3 v; y: a
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
, Y! A) g5 M) W* Y1 i<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">- d1 a) {' O; P' S/ M" D
<html>: H- ^) D6 ^, K" v5 ^+ J
<head>
- n4 b' v! e* H; `4 C <base href="<%=basePath%>">! Q! y6 a0 w4 f c M" M
3 ~5 p! ~' H: W8 ]0 m- Q
<title>采购信息</title>
8 P" V) N4 m: E, Q8 b: `
. S4 b, W' }7 p% _+ B9 L4 }/ K <meta http-equiv="pragma" content="no-cache">4 i' c5 u% W# s8 d# z* @1 M( o. T0 u0 p
<meta http-equiv="cache-control" content="no-cache">
: [+ e4 U: n3 C- c b" {4 b( L <meta http-equiv="expires" content="0">' T! m+ l a% E# v
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">/ Z% _' r- `, B6 F1 k
<meta http-equiv="description" content="This is my page">* T, l+ T4 D& n3 g8 e1 d! [5 J
<!--
& A/ B7 K: c. d <link rel="stylesheet" type="text/css" href="styles.css">
: O) H0 }. C7 A! a -->
% }- g" s% i: X$ r. @3 {& O" n: q o W
</head>8 |7 }# j1 W* T
<script language="javascript" type="text/javascript" src="<%=path %>/My97DatePicker/WdatePicker.js" defer="defer" >5 I7 i, L" g. f: `. _' ~
</script># Y, p- B7 k7 h$ Y
<script type="text/javascript">
- `$ e* c* L! K/ B s //添加按钮& U8 T0 n3 P* y& a
function add(){
; O% O+ j6 `; j: U e document.thisForm.action="buyadd.jsp";
! P$ l8 d; P1 T& W* l9 I! Q document.thisForm.submit();) L e' t* _7 o, y+ V5 R q! O
}. @' z+ c0 W7 F) d7 ]! ~
//修改按钮0 r# ~0 s& F! L& U1 {& F
function change(id){3 C6 d; z3 u( {. J6 S1 j
document.thisForm.action="OrderServlet?method=queryByid&flag=0&id="+id; t4 @! F% E' ]& [/ _; i
document.thisForm.submit();; m4 U# y( Z: ?# T( O& w; y
}//查询按钮
2 b8 o2 }# p2 Z& e //function query() {
1 N( I' ]5 d H* w# i; p //var oid = document.thisForm.oid.value;
6 W) p( {* D& Y' J$ K //var gname = document.thisForm.gname.value;
8 k3 ]; z' {2 [; q9 _ //document.thisForm.action="OrderServlet?method=queryid&flag=0&id="+oid+"&name="+gname;
+ {3 T& s! K0 b; |2 f" O' A //document.thisForm.submit();1 z+ [$ I/ x6 }6 c5 k
//}! ~' |% ?# R; @; m6 m( i( S% Q$ m
function search(){
; d1 X. F: x, M document.thisForm.action="ProfitServlet?method=queryList";9 v! H X/ H& Z3 [
document.thisForm.submit();, v9 m6 @5 n" I
}: \" S# v; B N" m
</script># Q; z6 Q/ h U; ?1 V
<body># u1 c1 z2 z# k! g/ i# r1 V2 O+ O
<form action="" method="post" name="thisForm">8 B$ \8 a. J* `; v
<table width="100%" border="0" cellspacing="0" cellpadding="0">2 `( b, J# U# H7 I7 J
<tr>0 Z# v: r7 C- b9 k' E) X
<td>1 b5 _ T: p4 i& L: k0 ]* N# r
<table width="100%" border="0" cellpadding="0" cellspacing="1"( Q3 H |5 Z( j% n6 K3 ?- J
bgcolor="#c5dbed">
" ~% ^ I6 s0 d1 w/ V8 y. t1 o <tr>9 X; }2 G/ h5 J9 w; ~ z. H. k3 f
<th height="29" background="images/bg_MainTable.jpg">" z, [1 {0 ]2 ^5 p1 q* O4 M
<!--主表格标题 开始-->
9 S P+ [9 |, E' {8 k; Q% L <table width="100%" border="0" cellspacing="0" cellpadding="0">" R: x2 m: t5 r/ q! U
<tr>
9 Q/ f+ T: g+ c/ Y <th align="left" class="STYLE1">
* y2 O8 r1 C1 E, l; F: ^0 h 采购信息查询: _! |5 |. d4 p8 H
</th>
; g9 _! J2 Z( v# V' f <th width="57" align="left">: J, }/ q0 U6 R3 H1 \% S
' z J: Z# }7 L( ? </th>" V6 w% F- \! V2 N( U) g
</tr>4 M+ Y" r4 r/ O1 }
</table>4 `7 L) P' f; Y0 j! R7 r. c. ~) d
</th>) a9 x# R; [* ?& l3 r% o
</tr>
U0 b! k# a9 N; C7 m1 o9 D <tr>, R* N( F2 `1 C0 V! t/ y" z( K
<td align="center" valign="top" bgcolor="#FFFFFF">& [# Y9 z( K) \& ^9 n6 l
<table width="100%" border="0" cellspacing="0" cellpadding="5"> j: K1 y( {# |& F8 P- e! ^% k
<tr>6 ~0 O$ X6 h! Q* _: u
<td>+ b( X+ j4 X& o/ X" l
<table width="90%" border="0" cellspacing="0"
; {9 N. q2 A, W. y* q/ D4 v cellpadding="5">
9 \! W) F8 O' I6 d+ b <tr>9 t' l9 d9 u" z8 f4 Q
<td align="left">
" {( ^+ O' m9 A' s 采购编号:+ e$ W& k$ J$ U
<input type="text" class="inputbox_01"
2 ^7 K% E& Y2 Z7 s) i1 g, V style="width: 100px" name="oid" />$ g. M2 \- K* m# R2 ?" p/ j% M
</td>
: S, f1 t* X# k <td align="left">
2 V2 s* `+ T/ {1 o7 ^ s 商品名称:# e- r/ E; B' ?) B; p7 A& b1 ~
<input type="text" class="inputbox_01"
, v; T! W- I% d" J* {( @ style="width: 100px" name="gname" />; w! K5 V% J# i5 V) J
</td>7 m! i/ ?9 o2 l- @# y8 g
<td align="left">
: L5 |6 n1 B0 e* J 采购日期:
5 f$ E8 g; i, J/ _ <input type="text" class="inputbox_01" style="width: 120px" name="starttime" value="${ticketInfo.datetime}" />8 C4 n5 Z' Z0 _9 l, J& _$ P3 W
至
6 h) `. h7 I1 ^. b- @3 K <input type="text" class="inputbox_01" style="width: 120px" name="endtime" value="${ticketInfo.datetime}"/>4 p# j3 o4 L p% K* i0 q
' D7 g7 r2 Q" N/ _ </td>9 w1 v! e _* q6 D( y" ^) n/ W
<td width="10%" align="right">
, Q7 @* ]. l6 o/ E( g <input type="button" name="button" id="button" value="查询"5 J h. G1 x) B/ G; Z
class="btn_01" />* D D* Y2 r: O1 D/ n
</td>
5 k7 M7 N, D5 |: w* _/ S3 p% j/ C% b <td width="10%" align="right">
8 a/ T( h8 e. k/ m6 `* L. e <input type="button" name="button" id="button" value="添加"
4 Z1 W2 Z/ m v; d( @4 r+ ^ class="btn_01" />4 z( [8 Z3 E" r+ `$ l+ g- [0 {
</td># K. y# ]; `' Q9 @& s- T* W
</tr>
1 ~/ z/ U+ C1 N' V) M) q$ n& b7 D, S </table>: A w$ C% {+ s- m# o9 X2 S+ i
<!--查询区域 结束 -->% v0 A, Z, j, Y! C7 Y& J
</table>1 r( `% \: P0 Z% \4 t. ~% t9 I" Z
4 e: r7 o+ t) K. q5 M" @" N \ </td>; l) l/ y9 i4 E" K; j8 I* w
</tr>
1 x! ^& }5 `3 o$ |# Q0 b
4 e7 D+ ?* ]8 G <tr>% e- @. k( G& b4 @, S
<td height="88" bgcolor="#FFFFFF">
1 X1 D9 e+ J( Z( b* S1 b1 S0 ^( y <table width="100%" border="1" cellpadding="0" cellspacing="0">) T1 h, @* Q# U+ E1 R! ]: l# _
<!--子表格标题 开始 -->
2 j! Q( A8 c1 P# Q5 j+ E <tr># p9 a; U9 ~( O9 {1 Y/ X6 e
<th width="8%" height="23" background="images/bg_MainTh.jpg"
, [# }& P: U# {( M! H' [: [' {# z; x class="color_254374">
! [. ]* {; Q; D% x3 N0 H. R 采购编号7 Y& T: n4 H- Y1 j$ p
</th>* i! p( F, L+ M% E1 G1 O# u
<th width="8%" height="23" background="images/bg_MainTh.jpg"
/ K5 E* t6 U, m# ^1 I class="color_254374">
) W' _5 X0 z& D) n 商品名称/ f' _, V6 F3 l# L9 R# W1 D
</th>- U* r" K2 B) |; x2 h1 X
<th width="8%" height="23" background="images/bg_MainTh.jpg"
6 e6 S) T3 K7 O6 s class="color_254374">
0 M5 n* X3 v+ z5 F. H2 A 采购人员
0 t2 i1 ^' v5 ^ </th>. o2 {* ?2 j4 A; N5 q/ Y/ n$ f4 \
<th width="8%" background="images/bg_MainTh.jpg"3 Z1 `9 U# q9 `1 ]( i" H4 t( \- B
class="color_254374">' x' \" G$ o u* n* D
采购数量
$ k0 G( m. H* J; C+ X | </th>7 P$ e3 ]% K1 E1 C
<th width="8%" background="images/bg_MainTh.jpg"
" U3 U2 \. [4 q class="color_254374">" Z$ R& l( T8 z
采购价格
4 g) Y/ G3 b4 x: x& G9 ` </th>
~" x. T/ i' e/ I <th width="8%" background="images/bg_MainTh.jpg"
- s$ i, n6 \0 Z' Q class="color_254374">
: f. @7 ~; @5 _( s# V9 L 采购日期
3 B( w9 g9 I5 ^0 e* o </th>; j8 M; \, T0 |+ J
<th width="8%" background="images/bg_MainTh.jpg"
/ N8 W0 a% Y% s4 z5 D# t class="color_254374">' ]6 M7 b) j8 T- W& p4 }
操作/ n. U! ]2 ?: k. K+ }$ I
</th>
3 P+ @, G' Y: U/ U8 r </tr>
$ R" t( r0 Y) T/ E, j( s) A, U <!--子表格标题 结束 -->
& I* x& {" [* ?2 _+ u# R <!--子表格列表 开始 --># H$ X7 d" ~9 E. N0 n! G. H
<c:forEach var="map" items="${list}">/ s- n0 q! r+ y' b; D
<tr>
" \$ E" `1 L Q W) s( D7 f" R" J <td align="center">
1 k* t6 Q/ t1 p ${map.o_id }5 W( [# Q6 k" k7 W. `! z
</td>7 V1 m' L/ K2 L
<td height="24" align="center">
: F# ~ D& I9 A: k$ h" s ${map.g_name }6 \( E7 S: X3 a3 Z; \7 t$ [ {# d5 p9 P
</td>6 D& g6 J. X1 D/ ]" U" h$ p! d
<td height="24" align="center">
* r5 N2 {7 `1 w+ v6 _ ${map.p_name }
1 l0 T- O* O8 q9 q' Q </td>1 M- H9 e. n! `9 v5 W, N
<td height="24" align="center">$ f: N6 F0 W1 Y3 b
${map.o_count }
4 h8 M/ V5 k* S; Q2 Q) h0 S+ p </td>
" C# t$ o, i4 F1 W' J* F1 a$ a+ ^ <td height="24" align="center">
" v0 `/ Z3 P$ I; R+ f+ S' F ${map.o_price }
8 u2 C: h, g+ H) E3 r </td>9 H5 ~' `5 W$ O* _, j" B
<td height="24" align="center">+ x5 `' o& H2 ?( @) q- h5 v& Z
${map.o_date }
( U6 O3 g4 o6 g' F6 R" f$ ] </td>3 t, j% o) `: ~+ `5 i
<td align="center">
; O I2 z, I# J, ]3 y7 G <input type="button" name="button" id="button" value="修改"
/ v( \& f0 P5 W" _. E9 Y class="btn_02" />
X8 D; e3 r$ i9 `+ k4 H$ {$ |9 q </td>9 L6 s3 x! T! H; g; L
</tr>- q8 ~' T6 X7 l2 V( N, @0 B
</c:forEach>
& H6 [- f6 S0 W/ a </table>
8 z! m. E3 @+ `+ i$ k% {" X6 R <!--子表格列表 结束 -->
6 D/ g% b2 g1 K+ H3 l </td>
& W/ O3 r1 b$ B/ q </tr>
0 x# t9 n! E$ g; _% V </table>4 g' C7 I" a$ f' ^( H6 J( R+ Z
. J9 z5 y! ]% y3 n! l" h <table>3 r f( T0 S7 U+ ^8 m0 v1 }4 z: l
<tr>% c) N9 i5 F* z' E% _( N
<td align="center">7 l$ Z5 G" ^& D8 I9 F& ~* P
当前第${requestScope.pageNo}页,共${requestScope.totalPage}页
' {4 d; `( }: f7 _+ j </td>. j# ^9 t+ c- g9 { P
<c:if test="${fg==0}">
" x" @' K5 b. y& t1 Y0 i0 _! c8 s <td align="center">" z( A4 D1 C5 {. L# a6 r) h) }
<a href="OrderServlet?method=query&flag=0&pageNo=1">首页</a>' U) ^, O! R3 u$ s
</td>
* b6 u3 B; W$ L* |* J+ |2 A3 A2 I M' h <td align="center">
/ L2 Q2 Q# P4 s5 k+ B7 M, O" E <c:if test="${requestScope.pageNo>1}">, @( b0 k4 v$ l+ v
<a2 U/ a. D6 O2 ?1 u3 `
href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo-1}">上一页</a>2 G0 J* |3 q: f" W' `% y
</c:if>
& ?) M8 d/ y, H* \ </td>6 ~3 X; j4 Q3 o2 w( k
<td align="center">
: F3 a7 C4 e% [ <c:if test="${requestScope.pageNo<requestScope.totalPage}">
# f( M8 {# D2 S. \; [" |2 ] <a4 H7 |) ]% ]7 W; x! s! _" _
href="OrderServlet?method=query&flag=0&pageNo=${requestScope.pageNo+1}">下一页</a>$ h% D3 A& @$ R" ~5 m
</c:if>
. u, U: d; Q6 U" } </td>
- G" l2 j! T3 y0 g" C1 R2 d& ^% ] <td align="center">
6 o) _5 A4 U% e <a4 M, k$ {: a7 ]; a$ A0 g' E
href="OrderServlet?method=query&flag=0&pageNo=${requestScope.totalPage}">尾页</a>
" S- D3 V4 m% p) x( t </td>
/ s" G/ b( ~' W! {2 U </c:if>
5 C1 z( X- M9 U! e: g& P# C </tr>
$ @* [4 [/ X3 F6 c3 g* a( m3 j </table>7 H5 d5 c# h, `* K! ]- R r
</table>
q) M l$ {; g7 u( a& s+ l </body>
" J7 N# `- ?# s1 x4 v4 y</html>
5 w$ z* g; s w& V2 \
/ E6 D0 ?4 A6 R1 U# ]1 P* T1 z/ S f6 N5 v w
|
|