码迷,mamicode.com
首页 > 其他好文 > 详细

ReportViewer导出功能筛选

时间:2014-10-29 10:42:57      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   os   ar   for   sp   div   

ReportViewer只能导出Excel,把导出Word和PDF功能去掉

 

 <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
                InteractiveDeviceInfos="(集合)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
                Width="100%" Height="100%" ShowToolBar="true" ShowBackButton="False" ShowFindControls="False"
                ShowRefreshButton="False" HyperlinkTarget="_self" 
                InteractivityPostBackMode="AlwaysSynchronous" 
                onprerender="ReportViewer1_PreRender">
            </rsweb:ReportViewer>
foreach (RenderingExtension extension in ReportViewer1.LocalReport.ListRenderingExtensions())
            {
                if (extension.Name == "IMAGE" || extension.Name == "WORD"|| extension.Name == "PDF")
                {
                    FieldInfo fi = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);
                    fi.SetValue(extension, false);
                }
            }  

 

ReportViewer导出功能筛选

标签:style   blog   io   color   os   ar   for   sp   div   

原文地址:http://www.cnblogs.com/yuking/p/4058683.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!