http://blog.csdn.net/even0220/article/details/6960540
RDL和RDLC在筛选导出项时有区别!
RDLC:需要在ReportViewer的PreRender方法中处理即可。
HTML:
- <rsweb:ReportViewer ID="rpvReportDL" runat="server" Width="973px"
- Height="470px" onprerender="reportViewer_PreRender">
- </rsweb:ReportViewer>
- protected void reportViewer_PreRender(object sender, EventArgs e)
- {
- foreach (RenderingExtension extension in rpvReportDL.LocalReport.ListRenderingExtensions())
- {
- if (extension.Name == "IMAGE" || extension.Name == "WORD")
- {
- FieldInfo fi = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);
- fi.SetValue(extension, false);
- }
- }
- }
RDL:修改配置文件
File: Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSReportDesigner.config
别忘记重启 Reporting Services
Enabled:
- <Extension Name="EXCEL"
- Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering"/>
Disabled:
- <Extension Name="EXCEL"
- Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering"
- Visible="false"/>