ReportViewer导出功能筛选

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>

        protected void ReportViewer1_PreRender(object sender, EventArgs e)
        {
        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); } }
    }

 

你可能感兴趣的:(view)