zoukankan
html css js c++ java
ASP.NET 页面打印与预览
<
html
>
<
head
>
<
title
>
ASP.NET 打印 - 所见即所得
</
title
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
>
<
script
language
="javascript"
>
function
preview()
{
bdhtml
=
window.document.body.innerHTML;
sprnstr
=
"
<!--startprint-->
"
;
eprnstr
=
"
<!--endprint-->
"
;
prnhtml
=
bdhtml.substr(bdhtml.indexOf(sprnstr)
+
17
);
prnhtml
=
prnhtml.substring(
0
,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML
=
prnhtml;
window.print();
//
prnform.htext.value=prnhtml;
//
prnform.submit();
//
alert(prnhtml);
}
</
script
>
</
head
>
<
body
bgcolor
="#FFFFFF"
text
="#000000"
>
辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣
<
center
>
本部分以上不被打印
</
center
>
<!--
startprint
-->
<
table
width
="84%"
align
="center"
bgcolor
="#0000FF"
cellpadding
="2"
cellspacing
="1"
>
<
tr
bgcolor
="#6699FF"
>
<
td
>
<
div
align
="center"
>
标题一
</
div
>
</
td
>
<
td
>
<
div
align
="center"
>
标题二
</
div
>
</
td
>
<
td
>
<
div
align
="center"
>
标题三
</
div
>
</
td
>
<
td
>
<
div
align
="center"
>
标题四
</
div
>
</
td
>
<
td
>
<
div
align
="center"
>
标题五
</
div
>
</
td
>
</
tr
>
<
tr
bgcolor
="#6699FF"
>
<
td
>
</
td
>
<
td
>
</
td
>
<
td
>
</
td
>
<
td
>
</
td
>
<
td
>
</
td
>
</
tr
>
</
table
>
<!--
endprint
-->
<
center
>
本部分以下不被打印
</
center
>
辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣辣
<
div
align
="center"
>
<
input
type
="button"
name
="print"
value
="预览并打印"
onclick
="preview()"
>
</
div
>
<
style
>
@media print
{
}
{
.Noprn {display
:
none
;
}
}
</
style
>
<
p
class
="Noprn"
>
不打印
</
p
>
<
table
id
=datagrid
><
tr
><
td
>
打印
</
td
></
tr
></
table
>
<
input
class
=Noprn
type
=button
onclick
="window.print()"
value
="print"
>
</
body
>
</
html
>
查看全文
相关阅读:
Https 原理与工作流程及证书链校验
ORA-12516, TNSlistener could not find available handler with matching protocol stack
报表框架整合记录20210422
Spring MVC
JasperReports with Spring
Spring Boot + Jasper Report + MySQL Database Example
Spring Boot + Jasper Report Example
JasperReports with Spring Boot
Spring 4 Jasper Report integration example with mysql database in eclipse
JasperReports Java Spring project
原文地址:https://www.cnblogs.com/zzxap/p/2175964.html
最新文章
GdiplusStartupInput 结构
regopenkeyex用法
史上最全阿里 Java 面试题总结及答案
Mybatis的一级缓存和二级缓存详解
实施技术面试题
编译nginx平滑添加stream模块
nginx 转发tcp连接
Nginx TCP协议
并发编程(十四)—— ScheduledThreadPoolExecutor 实现原理与源码深度解析 之DelayWorkQueue
top命令查看线程信息和jstack使用介绍
热门文章
babel之配置文件.babelrc入门详解
gitlab——项目代码迁移
.gitignore常见提交时需要忽略的文件
vs设置git 忽略文件
spring IoC 源码
linux chown 与 chmod 命令的使用
@Async异步操作及异步线程池
http连接池配置及spring boot restTemplate配置http连接池
防重放攻击实现
注解实现策略模式
Copyright © 2011-2022 走看看