主题:网页正常,为什么打印不出来?
我做了一个网页,浏览器显示正常,但是打印出来是空白的,用ie和tt都是这样,用firefox打印正常,网页主要是一个表格,从数据库读取数据,用asp,vbscript,javascript,一点线索也没有,谁知道怎么回事呀,正在截图呢,一会帖代码上来
[img]http://blog.programfan.com/upfile/200711/2007112121101.gif[/img]
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css" media="screen">
<!--
.STYLE1 {
font-size: 18px;
font-weight: bold;
font-family: "新宋体";
}
.STYLE2 {
font-size: 24px;
}
-->
</style>
<style type="text/css" media="print">
.nopr{display:none}
</style>
</head>
<%
dsn="dsn=rxdate; uid=sa; pwd=810723;"
set rs = Server.CreateObject("ADODB.recordset")
dy=""
dm=""
dd=""
page=1
maxperpage=16
if IsNumeric(request.Form("page")) then page=request.Form("page")
test1=request.Form("dyear")
test2=request.Form("dmon")
if IsNumeric(request.Form("maxperpage")) then
maxperpage=trim(request.Form("maxperpage"))
end if
if IsNumeric(trim(request.Form("dyear"))) then
if not IsNumeric(trim(request.Form("dmon"))) then
dy=trim(request.Form("dyear"))
sql="select * from 数据表 where 年='"&dy&"'"
else
if not IsNumeric(trim(request.Form("dday"))) then
dy=trim(request.Form("dyear"))
dm=trim(request.Form("dmon"))
sql="select * from 数据表 where 年='"&dy&"' and 月='"&dm&"'"
else
dy=trim(request.Form("dyear"))
dm=trim(request.Form("dmon"))
dd=trim(request.Form("dday"))
sql="select * from 数据表 where 年='"&dy&"' and 月='"&dm&"' and 日='"&dd&"'"
end if
end if
end if
if not isempty(sql) then
rs.open sql,dsn,1,1
if not (rs.eof or rs.bof) then
total=rs.recordcount
if total<=maxperpage then
totalpage=1
maxline=total
else
if (total mod maxperpage)=0 then
totalpage=total \ maxperpage
else
totalpage=(total \ maxperpage) + 1
end if
end if
if page>totalpage then page=totalpage
if page=totalpage then
maxline=(total mod maxperpage)
else
maxline=maxperpage
end if
end if
end if
%>
<body>
<table style="height: 18cm; width: 26cm;">
<tr><td><table width="100%" border="0" style="font:'楷体'"><tr><td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="nopr"><form method="post" action="rxtable.asp">
<tr>
<td><input name="dyear" type="text" size="4" value="<%=dy%>"/>年<input name="dmon" type="text" size="2" value="<%=dm%>"/>月<input name="dday" type="text" size="2" value="<%=dd%>"/>日
<input name="page" type="text" size="2" value="<%=page%>" />页(共<%=totalpage%>页)
每页行数:<input name="maxperpage" type="text" size="4" value="<%=maxperpage%>" /><input name="确定" type="submit" /><input type=button value=" 打 印 " onclick="window.print()">
</td>
</tr></form>
</table></td><td>编号:</td></tr><tr><td width="15%"></td>
<td width="70%" rowspan="2"><div align="center" class="STYLE1 STYLE2">库存商品明细账</div></td>
<td>名称:</td></tr><tr><td> 库:</td><td> 规格:</td></tr><tr><td> 区:</td><td></td><td> 单位:</td></tr><tr><td></td><td></td><td> 第 页</td></tr></table></td></tr>
<tr><td valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="0" style="width:25cm">
<tr>
<td colspan="2"><%=dy%> </td>
<td colspan="2" align="center">凭证</td>
<td rowspan="3" align="center" style="width:5cm">摘 要</td>
<td colspan="12" align="center">增 加</td>
<td colspan="12" align="center">减 少</td>
<td colspan="12" align="center">余 额</td>
<td width="10" rowspan="3" align="center">对
帐
符
号</td>
</tr>
<tr>
<td width="16" rowspan="2">月</td>
<td width="16" rowspan="2">日</td>
<td width="8" rowspan="2">字</td>
<td width="8" rowspan="2">号</td>
<td width="8" rowspan="2" align="center">数
量</td>
<td rowspan="2" align="center" style="width:3cm">单价</td>
<td colspan="10" align="center">金 额</td>
<td width="8" rowspan="2">数
量</td>
<td rowspan="2" align="center" style="width:3cm">单价</td>
<td colspan="10" align="center">金 额</td>
<td width="8" rowspan="2">数
量</td>
<td rowspan="2" width="20" align="center">单价</td>
<td colspan="10" align="center">金 额</td>
</tr>
<tr>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
</tr>
<%
if not isempty(sql) then
if not (rs.eof or rs.bof) then
rs.movefirst
if page>1 then
rs.move(maxperpage*(page-1))
end if
for i=1 to maxline
dim adda,addc
adda=split(rs("增加"),"|")
nl=len(adda(2))
redim addc(10)
for j=0 to (10-nl)
addc(j)="&nbsp;"
next
for j=(11-nl) to 10
addc(j)=mid(adda(2),(j-(10-nl)),1)
next
dim rda,rdc
rda=split(rs("减少"),"|")
nl=len(rda(2))
redim rdc(10)
for j=0 to (10-nl)
rdc(j)="&nbsp;"
next
for j=(11-nl) to 10
rdc(j)=mid(rda(2),(j-(10-nl)),1)
next
dim rma,rmc
rma=split(rs("减少"),"|")
nl=len(rma(2))
redim rmc(10)
for j=0 to (10-nl)
rmc(j)="&nbsp;"
next
for j=(11-nl) to 10
rmc(j)=mid(rma(2),(j-(10-nl)),1)
next
%>
<tr>
<td><%select case len(rs("月"))
case 0
response.Write("&nbsp;")
case 1
response.Write("0")
end select%><%=rs("月")%></td>
<td><%select case len(rs("日"))
case 0
response.Write("&nbsp;")
case 1
response.Write("0")
end select%><%=rs("日")%></td>
<td> </td>
<td> </td>
<td><%=rs("name")%></td>
<td><%=adda(0)%></td>
<td><%=adda(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=addc(k)%></td>
<%
end if
next
%>
<td><%=rda(0)%></td>
<td><%=rda(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=rdc(k)%></td>
<%
end if
next
%>
<td><%=rma(0)%></td>
<td><%=rma(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=rmc(k)%></td>
<%
end if
next
%>
<td> </td>
</tr>
<%
rs.movenext
next
if maxline<maxperpage then
for i=1 to (maxperpage-maxline)
%>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<%
next
end if
end if
else
%>
<tr>
<td colspan="42">请选择日期<%=sql%><%=dy%><%=dm%><%=test1%><%=test2%></td>
</tr>
<%end if%>
</table></td></tr></table>
</body>
</html>
[img]http://blog.programfan.com/upfile/200711/2007112121101.gif[/img]
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css" media="screen">
<!--
.STYLE1 {
font-size: 18px;
font-weight: bold;
font-family: "新宋体";
}
.STYLE2 {
font-size: 24px;
}
-->
</style>
<style type="text/css" media="print">
.nopr{display:none}
</style>
</head>
<%
dsn="dsn=rxdate; uid=sa; pwd=810723;"
set rs = Server.CreateObject("ADODB.recordset")
dy=""
dm=""
dd=""
page=1
maxperpage=16
if IsNumeric(request.Form("page")) then page=request.Form("page")
test1=request.Form("dyear")
test2=request.Form("dmon")
if IsNumeric(request.Form("maxperpage")) then
maxperpage=trim(request.Form("maxperpage"))
end if
if IsNumeric(trim(request.Form("dyear"))) then
if not IsNumeric(trim(request.Form("dmon"))) then
dy=trim(request.Form("dyear"))
sql="select * from 数据表 where 年='"&dy&"'"
else
if not IsNumeric(trim(request.Form("dday"))) then
dy=trim(request.Form("dyear"))
dm=trim(request.Form("dmon"))
sql="select * from 数据表 where 年='"&dy&"' and 月='"&dm&"'"
else
dy=trim(request.Form("dyear"))
dm=trim(request.Form("dmon"))
dd=trim(request.Form("dday"))
sql="select * from 数据表 where 年='"&dy&"' and 月='"&dm&"' and 日='"&dd&"'"
end if
end if
end if
if not isempty(sql) then
rs.open sql,dsn,1,1
if not (rs.eof or rs.bof) then
total=rs.recordcount
if total<=maxperpage then
totalpage=1
maxline=total
else
if (total mod maxperpage)=0 then
totalpage=total \ maxperpage
else
totalpage=(total \ maxperpage) + 1
end if
end if
if page>totalpage then page=totalpage
if page=totalpage then
maxline=(total mod maxperpage)
else
maxline=maxperpage
end if
end if
end if
%>
<body>
<table style="height: 18cm; width: 26cm;">
<tr><td><table width="100%" border="0" style="font:'楷体'"><tr><td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="nopr"><form method="post" action="rxtable.asp">
<tr>
<td><input name="dyear" type="text" size="4" value="<%=dy%>"/>年<input name="dmon" type="text" size="2" value="<%=dm%>"/>月<input name="dday" type="text" size="2" value="<%=dd%>"/>日
<input name="page" type="text" size="2" value="<%=page%>" />页(共<%=totalpage%>页)
每页行数:<input name="maxperpage" type="text" size="4" value="<%=maxperpage%>" /><input name="确定" type="submit" /><input type=button value=" 打 印 " onclick="window.print()">
</td>
</tr></form>
</table></td><td>编号:</td></tr><tr><td width="15%"></td>
<td width="70%" rowspan="2"><div align="center" class="STYLE1 STYLE2">库存商品明细账</div></td>
<td>名称:</td></tr><tr><td> 库:</td><td> 规格:</td></tr><tr><td> 区:</td><td></td><td> 单位:</td></tr><tr><td></td><td></td><td> 第 页</td></tr></table></td></tr>
<tr><td valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="0" style="width:25cm">
<tr>
<td colspan="2"><%=dy%> </td>
<td colspan="2" align="center">凭证</td>
<td rowspan="3" align="center" style="width:5cm">摘 要</td>
<td colspan="12" align="center">增 加</td>
<td colspan="12" align="center">减 少</td>
<td colspan="12" align="center">余 额</td>
<td width="10" rowspan="3" align="center">对
帐
符
号</td>
</tr>
<tr>
<td width="16" rowspan="2">月</td>
<td width="16" rowspan="2">日</td>
<td width="8" rowspan="2">字</td>
<td width="8" rowspan="2">号</td>
<td width="8" rowspan="2" align="center">数
量</td>
<td rowspan="2" align="center" style="width:3cm">单价</td>
<td colspan="10" align="center">金 额</td>
<td width="8" rowspan="2">数
量</td>
<td rowspan="2" align="center" style="width:3cm">单价</td>
<td colspan="10" align="center">金 额</td>
<td width="8" rowspan="2">数
量</td>
<td rowspan="2" width="20" align="center">单价</td>
<td colspan="10" align="center">金 额</td>
</tr>
<tr>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">万</td>
<td width="8">千</td>
<td width="8">百</td>
<td width="8">十</td>
<td width="8">元</td>
<td width="8">角</td>
<td width="8">分</td>
</tr>
<%
if not isempty(sql) then
if not (rs.eof or rs.bof) then
rs.movefirst
if page>1 then
rs.move(maxperpage*(page-1))
end if
for i=1 to maxline
dim adda,addc
adda=split(rs("增加"),"|")
nl=len(adda(2))
redim addc(10)
for j=0 to (10-nl)
addc(j)="&nbsp;"
next
for j=(11-nl) to 10
addc(j)=mid(adda(2),(j-(10-nl)),1)
next
dim rda,rdc
rda=split(rs("减少"),"|")
nl=len(rda(2))
redim rdc(10)
for j=0 to (10-nl)
rdc(j)="&nbsp;"
next
for j=(11-nl) to 10
rdc(j)=mid(rda(2),(j-(10-nl)),1)
next
dim rma,rmc
rma=split(rs("减少"),"|")
nl=len(rma(2))
redim rmc(10)
for j=0 to (10-nl)
rmc(j)="&nbsp;"
next
for j=(11-nl) to 10
rmc(j)=mid(rma(2),(j-(10-nl)),1)
next
%>
<tr>
<td><%select case len(rs("月"))
case 0
response.Write("&nbsp;")
case 1
response.Write("0")
end select%><%=rs("月")%></td>
<td><%select case len(rs("日"))
case 0
response.Write("&nbsp;")
case 1
response.Write("0")
end select%><%=rs("日")%></td>
<td> </td>
<td> </td>
<td><%=rs("name")%></td>
<td><%=adda(0)%></td>
<td><%=adda(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=addc(k)%></td>
<%
end if
next
%>
<td><%=rda(0)%></td>
<td><%=rda(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=rdc(k)%></td>
<%
end if
next
%>
<td><%=rma(0)%></td>
<td><%=rma(1)%></td>
<%
for k=0 to 10
if k<>8 then
%>
<td><%=rmc(k)%></td>
<%
end if
next
%>
<td> </td>
</tr>
<%
rs.movenext
next
if maxline<maxperpage then
for i=1 to (maxperpage-maxline)
%>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<%
next
end if
end if
else
%>
<tr>
<td colspan="42">请选择日期<%=sql%><%=dy%><%=dm%><%=test1%><%=test2%></td>
</tr>
<%end if%>
</table></td></tr></table>
</body>
</html>