惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
雷峰网
雷峰网
S
Securelist
V
Vulnerabilities – Threatpost
S
SegmentFault 最新的问题
T
The Exploit Database - CXSecurity.com
A
About on SuperTechFans
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
L
Lohrmann on Cybersecurity
S
Security Affairs
S
Secure Thoughts
P
Privacy & Cybersecurity Law Blog
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
Spread Privacy
Spread Privacy
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
H
Heimdal Security Blog
L
LINUX DO - 热门话题
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
D
DataBreaches.Net
N
Netflix TechBlog - Medium
The Hacker News
The Hacker News
N
News and Events Feed by Topic
C
Check Point Blog
博客园_首页
Scott Helme
Scott Helme
T
Troy Hunt's Blog
U
Unit 42

博客园 - Flymouse

Error CS0006 when invoking MSBuild from command line 一个Cookie引起的混乱 数据库错误:在执行批处理时出现错误。错误消息为: 目录名无效 NorthScale MemBase Server 1.6 的使用 使用网络目录映射虚拟目录出现 500.19 权限不足问题的一个解决办法 URL重写给 asp.net Ajax带来的问题 调整viewState的位置,有助于SEO C# Excel进程关闭 - Flymouse - 博客园 2个Excel异常处理 Win7 x64 IIS7支持32位应用程序 在.net中与mysql数据库的时候碰到显示不了中文字符的情况实现! 完美解决IFRAME中COOKIE、SESSION丢失 关于Ucenter在IIS中有时出现“Access denied for agent changed”错误。 如何將 Access 的 Memo 型態欄位匯入到 SQL2005 的 nvarchar 型態欄位 .net wap强制输出WML - Flymouse - 博客园 使用Extjs的Form无法输入的问题 jQuery滚屏代码,还有一点地方封装不进去 - Flymouse - 博客园 ASP.NET 2.0 中动态添加 GridView 模板列的例子 关于使用 jquery Validate 使用出现的问题
关于限制水晶报表的导出格式
Flymouse · 2010-04-08 · via 博客园 - Flymouse

最近有业务需求,在使用水晶报表时导出格式要求限制为PDF,但是水晶报表的reportviewer没有提供这样的选项,没有办法只好使用hack的水晶报表的到处对话框的方式来实现。

具体实现为找到 “\aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer4\html\crystalexportdialog.htm” 文件,修改为以下代码:

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	</head>
	<body>
		<script language="javascript">
<!--
// export UI functions
function check(obj) {
	return !obj.disabled;
}

function toggleRangeFields(obj) {
	if( obj.id == "radio1") {
		document.Export.from.disabled = true;
		document.Export.to.disabled = true;
	}
	else {
		document.Export.from.disabled = false;
		document.Export.to.disabled = false;
	}
	return check(obj);
}

function checkDisableRange() {
	if( document.Export.exportformat.value == "CrystalReports"
		|| document.Export.exportformat.value == "RecordToMSExcel" ) {
		if( document.Export.isRange[1].checked ) {
			document.Export.isRange[0].checked = true;
		}
		document.Export.isRange[1].disabled = true;
		document.Export.from.disabled = true;
		document.Export.to.disabled = true;
	}
	else {
		document.Export.isRange[1].disabled = false;
	}
}

function isValidNumber(number) {
	var nonDigit = /\D+/;
	if( nonDigit.test(number) || number == '0' || number == "") {
		return false;
	}
	return true;
}

function checkValuesAndSubmit() {
	if( document.Export.isRange[1].checked ) {
		if (!isValidNumber(document.Export.from.value) || !isValidNumber(document.Export.to.value) || (parseInt(document.Export.from.value, 10) > 

parseInt(document.Export.to.value, 10))) {
			alert(parent.parent.opener.L_InvalidPageRange);
			return;
		}
	}
	if( document.Export.exportformat != null && document.Export.exportformat.selectedIndex == 0 ) {
		alert(parent.parent.opener.L_ExportFormat);
		return;
	}
	document.Export.action = opener.document.getElementById('crystal_handler_page').value;
	document.Export.submit();
}

function init() {
    document.getElementById ('radio1').focus ();
    if (document.getElementById('reportsource')) {
	    document.getElementById('reportsource').value = parent.opener.document.getElementById('crystal_print_rptsrc').value;
	}
	if (document.getElementById('viewstate')) {
	    document.getElementById('viewstate').value = parent.opener.document.getElementById('crystal_print_vs').value;
	}
}

document.write(parent.parent.opener.getExportDialog());

var formatselect=document.getElementById('exportFormatList');
formatselect.options.length = 0; 
formatselect.options[0]=new Option("格式","");
formatselect.options[1]=new Option("Acrobat 格式 (PDF)","PDF");
-->
		</script>
	</body>
</html>

重点就是

var formatselect=document.getElementById('exportFormatList');
formatselect.options.length = 0; 
formatselect.options[0]=new Option("格式","");
formatselect.options[1]=new Option("Acrobat 格式 (PDF)","PDF");


用这个替换掉了原来的格式选择框