Home > ASP.Net > Hide Export To Excel and Word Option from ReportViewer in ASP.Net

Hide Export To Excel and Word Option from ReportViewer in ASP.Net


Hi all,

Try this example to Hide Export to Word and Excel Option from ReportViewer in ASP.Net

First Way :

 <style type="text/css">
a[title=Excel] {
display: none !important;
}
a[title=Word] {
display: none !important;
}
</style>

Second Way :

 <script type="text/javascript">
//-- To Hide ReportViewer Export to Word and Excel (Works)
window.onload = function () {
var formatDropDown = document.getElementById('ReportViewer1_ctl05_ctl04_ctl00_Menu');
var formats = formatDropDown.childNodes;
if (formatDropDown != null) {
formatDropDown.removeChild(formats[1]);
formatDropDown.removeChild(formats[2]);
}
}
</script>

Third Way :

 <script src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
//-- Another Way To Hide ReportViewer Export to Word and Excel (Works)
$(document).ready(function () {
$("a[title='Word']").parent().hide();
$("a[title='Excel']").parent().hide();
});
</script>

Hope this helps

Good Luck

Advertisements
Categories: ASP.Net
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: