网页内容打印

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="daochuepm.aspx.cs" Inherits="Web.emp.emp.daochuepm" %>

<!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 id="Head1" runat="server">
<title></title>
<link href="../../Public/Css/common.css" rel="stylesheet" type="text/css" />
<script src="../../Public/Js/jquery-1.8.0.min.js" type="text/javascript"></script>

<style type="text/css">
.commontab{text-align:center;760px;border-collapse:collapse;}
.commontab td,th{margin:0px;line-height:25px;font-size:14px;border:1px solid black;}
.commontab .tb{background-color:White;}
.commontab .bl{text-align:right;background-color:White;font-size:14px;}
.commontab .br{text-align:left;background-color:White;font-size:14px;}
.divtitle{ font-size:20px; font-weight:bold; text-align:center; 760px; margin-bottom:10px;}
.div{ font-size:16px; 760px;}
</style>
<script type="text/javascript">
$(function () {
execPrint();
});

var HKEY_Root, HKEY_Path, HKEY_Key;
HKEY_Root = "HKEY_CURRENT_USER";
HKEY_Path = "\Software\Microsoft\Internet Explorer\PageSetup\";
//设置网页打印的页眉页脚为空
function PageSetup_Null() {
try {
var Wsh = new ActiveXObject("WScript.Shell");
HKEY_Key = "header";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
HKEY_Key = "footer";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
}
catch (e) {
// alert(e.message);
}
};
function execPrint() {
PageSetup_Null();
window.print();
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="divtitle">人员列表</div> <%-- <div style="610px;float:right;font-weight:bold;font-size:14px;">R-6.3-11</div> <div style="610px;font-weight:bold;font-size:14px;">工程名称: <asp:Label ID="gcmc" runat="server"></asp:Label></div>--%> <table class="commontab">
<tr>
<td style="110px;">设备名称:</td>
<td style="230px;">
<asp:Label ID="sbmc" runat="server"></asp:Label>
</td>
<td style="110px;">设备编号:</td>
<td style="230px;">
<asp:Label ID="sbbh" runat="server"></asp:Label>
</td> </tr> <tr>
<td style="110px;">操作工:</td>
<td style="230px;">
<asp:Label ID="czg" runat="server"></asp:Label>
</td>
<td style="110px;">故障级别:</td>
<td >
<asp:Label ID="gzjb" runat="server"></asp:Label>
</td> </tr> <tr>
<td style="110px;">故障起始时间:</td>
<td style="230px;">
<asp:Label ID="gzkssj" runat="server"></asp:Label>
</td>
<td style="110px;">故障结束时间:</td>
<td >
<asp:Label ID="gzjssj" runat="server"></asp:Label>
</td> </tr> <tr>
<td style="110px;">故障持续时间:</td>
<td style="230px;">
<asp:Label ID="gzcxsj" runat="server"></asp:Label>
</td>
<td style="110px;"></td>
<td >

</td> </tr> <tr>
<td style="110px;">故障部位:</td>
<td colspan="3"; >
<asp:Label ID="gzbw" runat="server"></asp:Label>
</td> </tr> <tr>
<td style="110px;">维修单位:</td>
<td colspan="3";>
<asp:Label ID="wxdw" runat="server"></asp:Label>
</td> </tr> <tr>
<td style="110px;">故障原因:</td>
<td colspan="3";>
<asp:Label ID="gzyy" runat="server"></asp:Label>
</td>
</tr> <tr>
<td style="110px;">排除措施:</td>
<td colspan="3"; >
<asp:Label ID="pccs" runat="server"></asp:Label>
</td>
</tr> <tr>
<td style="110px;">验收结论:</td>
<td colspan="3"; >
<asp:Label ID="yzjl" runat="server"></asp:Label>
</td>
</tr> <tr>
<td style="110px;">参与人员:</td>
<td colspan="3"; >
<asp:Label ID="cyry" runat="server"></asp:Label>
</td>
</tr> </table>
</form>
</body>
</html>

原文地址:https://www.cnblogs.com/Zpyboke/p/5282600.html