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); } }
时间: 2024-10-10 20:12:57