jspSample1.jsp
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- <HTML xmlns:fc>
- <HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <TITLE></TITLE>
- <STYLE>
- @media all
- {
- fc:fc_code
- {
- behavior: url(webprint/fc_code.htc) ;
- }
- fc:webprint
- {
- behavior: url(webprint/webgrid.htc) ;
- }
- }
- </STYLE>
- </HEAD>
- <BODY onload="return window_onload()" >
- <%@page contentType="text/html;CharSet=gb2312"%>
- <%@page language="java" %>
- <%@page import="java.sql.*,java.io.*,java.util.*,java.lang.*,java.text.*,java.text.*,com.gforce.currency.web.*" %>
- <jsp:useBean id="conn" scope="page" class="connDb" />
- <%
- ResultSet rs = conn.executeQuery("SELECT fstrItemName,fstrItemDesc,fstrUnit,fstrItemStyle,fdblSalePrice FROM Item ");
- String tmpStr;
- %>
- <P><INPUT type=button value=打印预览 onclick="grid.print()"></P>
- <fc:webprint id="grid" >
- <table id=t cellPadding=0 cellSpacing=0 frame=box style="display:none;BORDER-COLLAPSE: collapse; FONT-SIZE: 13px; LEFT: 0px; POSITION: absolute; TABLE-LAYOUT: fixed; TOP: 0px; " bgColor=white borderColor=black>
- <colgroup><col style="WIDTH: 80px"><col style="WIDTH: 130px"><col style="WIDTH: 90px"><col style="WIDTH: 90px"><col style="WIDTH: 90px"></colgroup>
- <tr style="HEIGHT: 21px" bgcolor="#87cefa">
- <td align=middle>存货编码</td>
- <td align=middle>存货名称</td>
- <td align=middle>计量单位</td>
- <td align=middle>型号规格</td>
- <td align=middle>单价</td>
- </tr>
- <% while (rs.next()) { %>
- <TR style="HEIGHT: 21px">
- <% out.print("<TD>" + rs.getObject(1).toString() + "</TD>");
- tmpStr = new String(rs.getObject(2).toString().getBytes(),"ISO-8859-1");
- out.print("<TD>" + tmpStr + "</TD>");
- out.print("<TD>" + new String(rs.getObject(3).toString().getBytes(),"ISO-8859-1") + "</TD>");
- out.print("<TD>" + new String(rs.getObject(4).toString().getBytes(),"ISO-8859-1") + "</TD>");
- out.print("<TD>" + new String(rs.getObject(5).toString().getBytes(),"ISO-8859-1") + "</TD>");
- } %>
- </TR>
- <%rs.close(); %>
- </TABLE></fc:webprint>
- <SCRIPT LANGUAGE=javascript>
- <!--
- function window_onload() {
- //初始化表格的位置
- grid.left=5
- grid.top=80
- grid.width=550
- grid.height=300
- //设置页码
- grid.prn.top11="页码:(p)/(P)"
- grid.prn.title1=<% out.print(System.currentTimeMillis()); %>
- //显示隐藏的表格。
- grid.tab.style.display="block"
- }
- //-->
- </SCRIPT>
- </BODY>
- </HTML>