框架内数据的打印。。。。
body {
color : #000000;
background : #ffffff;
font-family : verdana,arial,sans-serif;
font-size : 12pt;
}
h2 {
font-size : 14pt;
}
a {
text-decoration : underline;
color : #0000ff;
}
table
{
border-right: #cc3366 1px solid;
border-top: #cc3366 1px solid;
border-left: #cc3366 1px solid;
border-bottom: #cc3366 1px solid;
}
#logo,#head,#menu,#tail,#printicon{
display : none;
}
#appendedlinks {
page-break-before: always
}
color : #000000;
background : #ffffff;
font-family : verdana,arial,sans-serif;
font-size : 12pt;
}
h2 {
font-size : 14pt;
}
a {
text-decoration : underline;
color : #0000ff;
}
table
{
border-right: #cc3366 1px solid;
border-top: #cc3366 1px solid;
border-left: #cc3366 1px solid;
border-bottom: #cc3366 1px solid;
}
#logo,#head,#menu,#tail,#printicon{
display : none;
}
#appendedlinks {
page-break-before: always
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" type="text/css"
href="Css/print.css" media="print" />
</head>
<body class ="body">
<form id="form1" runat="server">
<TABLE id="Table" class ="table">
<caption>
<font size='4' face='楷体_gb2312'>投诉表扬列表</font></caption>
<tr >
<td style="height: 20px">投诉表扬</td>
<td style="height: 20px">部门一</td>
<td style="height: 20px">部门二</td>
<td style="height: 20px">部门三</td>
<td style="height: 20px">部门四</td>
<td style="height: 20px">部门五</td>
<td style="height: 20px">部门六</td>
<td style="height: 20px">部门七</td>
<td style="height: 20px">部门八</td>
</tr>
<tr>
<td>当月投拆</td>
<td>
20
</td>
<td>
22
</td>
<td>4444</td>
<td>1000</td>
<td>2000</td>
<td>1003</td>
<td>59</td>
<td>22</td>
</tr>
<tr>
<td>当月表扬
</td>
<td>
20
</td>
<td width="62">
20
</td>
<td>22</td>
<td>8000</td>
<td>20</td>
<td>8000</td>
<td>4000</td>
<td>22</td>
</tr>
</TABLE>
<input id="tail" type="button" value="打印" class="head" onclick ="print()"/>
<input id ="head" type='button' class="Noprint" value='打印' onclick='document.all.WebBrowser.ExecWB(6,1)'
NAME="Button4"><object id='WebBrowser' classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height='0'
width='0' ></object><input id ="printicon" type='button' class="Noprint" value='打印预览' onclick='document.all.WebBrowser.ExecWB(7,1)'
NAME="Button4">
</form>
</body>
</html>
<!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 runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" type="text/css"
href="Css/print.css" media="print" />
</head>
<body class ="body">
<form id="form1" runat="server">
<TABLE id="Table" class ="table">
<caption>
<font size='4' face='楷体_gb2312'>投诉表扬列表</font></caption>
<tr >
<td style="height: 20px">投诉表扬</td>
<td style="height: 20px">部门一</td>
<td style="height: 20px">部门二</td>
<td style="height: 20px">部门三</td>
<td style="height: 20px">部门四</td>
<td style="height: 20px">部门五</td>
<td style="height: 20px">部门六</td>
<td style="height: 20px">部门七</td>
<td style="height: 20px">部门八</td>
</tr>
<tr>
<td>当月投拆</td>
<td>
20
</td>
<td>
22
</td>
<td>4444</td>
<td>1000</td>
<td>2000</td>
<td>1003</td>
<td>59</td>
<td>22</td>
</tr>
<tr>
<td>当月表扬
</td>
<td>
20
</td>
<td width="62">
20
</td>
<td>22</td>
<td>8000</td>
<td>20</td>
<td>8000</td>
<td>4000</td>
<td>22</td>
</tr>
</TABLE>
<input id="tail" type="button" value="打印" class="head" onclick ="print()"/>
<input id ="head" type='button' class="Noprint" value='打印' onclick='document.all.WebBrowser.ExecWB(6,1)'
NAME="Button4"><object id='WebBrowser' classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height='0'
width='0' ></object><input id ="printicon" type='button' class="Noprint" value='打印预览' onclick='document.all.WebBrowser.ExecWB(7,1)'
NAME="Button4">
</form>
</body>
</html>
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" EnableTheming="False" ImageUrl="http://photocdn.sohu.com/20050807/Img226590668.jpg" />
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" />
<iframe src=Default.aspx style="width: 456px; height: 365px" ></iframe>
</div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" EnableTheming="False" ImageUrl="http://photocdn.sohu.com/20050807/Img226590668.jpg" />
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" />
<iframe src=Default.aspx style="width: 456px; height: 365px" ></iframe>
</div>
</form>
</body>
</html>
上边还有点怪怪的东西就是用了webbrowser 时它的预览还有框架内的东西......