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

📄 statprint.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.text.*"%><%  request.setCharacterEncoding("GBK");  session=request.getSession();  userStruct user=(userStruct)session.getAttribute("user");  if(user==null){  response.sendRedirect("../../login.html");  }else{  Vector unit=(Vector)session.getAttribute("uni");  Vector eqname=(Vector)session.getAttribute("eqn");  UpreportStruct sample=new UpreportStruct();%><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=gb_2312-80"><link rel="stylesheet" href="../../css/sti.css" type="text/css"></HEAD><BODY><table width=800 class=title cellspacing=0 cellpadding=0 border=1 align=center ><tr align=middle><td width="4%">序&nbsp;号</td><td width="13%">设备名称</td><td width="13%">规格/型号</td><td width="9%">性&nbsp;&nbsp;质</td><td width="8%">计量单位</td><td width="5%">数&nbsp;量</td><td width="12%">投资金额</td><td width="15%">内容及用途</td><td width="21%">备&nbsp;&nbsp;&nbsp;&nbsp;注</td></tr><%for(int i=0;i<unit.size();i++){  int amount=0;  double money=0.00;  officeUnitStruct ous = new officeUnitStruct();   OfficeUnitControllerHome officeUnitControllerHome = null;  OfficeUnitController officeUnitController = null;   Context ctx1 = new InitialContext();          //look up jndi name          Object ref1 = ctx1.lookup("OfficeUnitController");          //cast to Home interface       officeUnitControllerHome = (OfficeUnitControllerHome) PortableRemoteObject.narrow(ref1, OfficeUnitControllerHome.class);           officeUnitController=officeUnitControllerHome.create();           Collection c=officeUnitController.getProcessName(unit.elementAt(i).toString());           Iterator a=c.iterator();           ous=(officeUnitStruct)a.next();  Context ctxx = new InitialContext(); //look up jndi name Object reff = ctxx.lookup("UpreportController"); //cast to Home interface UpreportControllerHome upreportControllerHome = (UpreportControllerHome) PortableRemoteObject.narrow(reff, UpreportControllerHome.class); UpreportController upreportController = upreportControllerHome.create(); Collection temp1=upreportController.getByUnitid(ous.unitid); Iterator b=temp1.iterator(); Integer l=new Integer(0); while(b.hasNext())                {                sample=(UpreportStruct)b.next();                if (sample.sortid.intValue()>l.intValue())                {l=sample.sortid;}                } Collection temp=new ArrayList(); b=temp1.iterator(); while(b.hasNext()) { sample=(UpreportStruct)b.next(); if(sample.sortid.equals(l))   {temp.add(sample);   amount=amount+sample.devnum.intValue();   money=money+sample.devmoney.doubleValue();} }%><tr align=middle>  <%   String order="";   if(i==0)   order="一";   if(i==1)   order="二";   if(i==2)   order="三";   if(i==3)   order="四";   if(i==4)   order="五";   if(i==5)   order="六";   if(i==6)   order="七";   if(i==7)   order="八";   if(i==8)   order="九";   if(i==9)   order="十";   if(i==10)   order="十一";   if(i==11)   order="十二";   if(i==12)   order="十三";   if(i==13)   order="十四";   if(i==14)   order="十五";%><td><%=order%></td><td><b><%=unit.elementAt(i)%></b></td><td>&nbsp;</td><td>&nbsp;</td><td>套</td><td><%=amount%></td><td><%=money%></td><td>&nbsp;</td><td>&nbsp;</td></tr><%Vector seqname=(Vector)eqname.elementAt(i);for(int j=0;j<seqname.size();j++){  b=temp.iterator();  while(b.hasNext())    {     sample=(UpreportStruct)b.next();       if(sample.devname.equals(seqname.elementAt(j)))         break;     } sample.devkind=request.getParameter("kind"+i+j); sample.devuse=request.getParameter("use"+i+j); sample.devdemo=request.getParameter("demo"+i+j); upreportController.edit(sample.upid,sample);%><tr align=middle><td><%=j+1%></td><td><%=sample.devname%></td><td><%=sample.devtype%></td><%if(!sample.devkind.equals("")){%><td><%=sample.devkind%></td><%}else {%><td>&nbsp;</td><%}%><td>套</td><td><%=sample.devnum%></td><td><%=sample.devmoney%></td><%if(!sample.devuse.equals("")){%><td><p><%=sample.devuse%></p></td>  <%}else{%>  <td>&nbsp;</td>  <%}if(!sample.devdemo.equals("")){%>  <td><p><%=sample.devdemo%></p></td>  <%}else{%>  <td>&nbsp;</td>  <%}%></tr><%}}%><%String lll="";if(user.unitid.intValue()==2)  lll="北方海区";if(user.unitid.intValue()==3)  lll="东海海区";if(user.unitid.intValue()==4)  lll="南海海区";if(user.unitid.intValue()==5)  lll="海南海事局";%><caption align=right><%=sample.year%>年<%=lll%>进口设备申请统计表 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=-5>单位:万元</font></caption></table><table align=center><tr>&nbsp;</tr><tr>&nbsp;</tr><tr align=middle><td><SCRIPT LANGUAGE="JavaScript">if (window.print) {document.write('<input type=button name=print class=file value=" 打  印 " '+ 'onClick="javascript:window.print()">');}</script></td><td>&nbsp;</td><td><input type="button" name="haha" value=" 返  回 " class="file" onClick="location='scheme_query.jsp'"></td></tr></table></BODY></HTML><%}%>

⌨️ 快捷键说明

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