⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statisticsgroup.jsp

📁 通过jsp/servlet实现web打印
💻 JSP
字号:
<%@ page contentType="text/html;charset=GBK" isELIgnored="false"%>
<%@page import="java.util.*"%>
<%@page import="bean.StatisticsObjBean;"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <base href="<%=basePath%>">
    <title>My JSP 'statisticsgroup.jsp' starting page</title>
  </head>
  <jsp:useBean id="sta" scope="session" class="bean.StatisticsObjBean"></jsp:useBean>
  <jsp:useBean id="get" scope="session" class="bean.GetMoneyHistoryBean"/>
  <body>
   
    <jsp:scriptlet>   
  	get.getuserGroup();   
  </jsp:scriptlet>
  <form action="GroupSta" method="post">
  <table width="60%" align="center" border="1">
  
  <tr>
  	<td >
  	组别:<select name="groupname">
    				<option value="7">
    					请选择
    				</option>
    			<c:forEach items="${get.getmoneyhistroy}" var="get">
    				<option value=<c:out value="${get[0]}" />>
    					<c:out value="${get[1]}"></c:out>
    				</option>
    			</c:forEach>
    		</select>
  	
  	<input type="submit" value="提交">
  	</td>
  </tr>
  </table>
  </form>
 
 
    <%
    	
    	String group=(String)session.getAttribute("group");
    %>
    <table width="60%" align="center" border="1">
    <tr>
    	<td align="center">组别</td>
    	<td align="center">项目名</td>
    	<td align="center">人数</td>
    	<td align="center">单价</td>
    	<td align="center">总价</td>
    </tr>
    <%
    	String a=(String)session.getAttribute("count") ;
    	int num=Integer.parseInt(a);
    	Vector v=(Vector)session.getAttribute("staobj");
    	if(v==null){
    		out.println("暂无数据");
    		
    	}else{
    	int rowspan=v.size();
    	
     %>
    <tr>
    	<td rowspan=<%=rowspan %> align="center">
    		<%=session.getAttribute("groupname") %>
    	</td>
    	<%
    	
	    	for(int i=0;i<v.size();i++){
	    	StatisticsObjBean sta1=(StatisticsObjBean)v.get(i);
	    	float fee=Float.parseFloat(sta1.getItemFee());
    	 %>
    	<td align="center">
    		<%=sta1.getItemName() %>
    	</td>
    	<td align="center">
    		<%=a %>
    	</td>
    	<td align="center">
    		<%=sta1.getItemFee() %>
    	</td>
    	<td align="center">
    		<%=num*fee %>
    	</td>
    </tr>
    <%
    	}}
     %>
   <tr>
   	<td colspan="5" align="right">
   	总计:RMB <%=session.getAttribute("allmoney") %>元
   
   	</td>
   </tr>
    </table>
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -