Disable PDF export type in ReportViewer v11 Visual Studio 2012 RRS feed

  • Question

  • We're using Visual Studio 2012 and the new ReportViewer control version 11.  We have code that successfully disabled the PDF export option on the report viewer in Visual Studio 2010, ReportViewer v10, but no longer works in the latest edition of Visual Studio (2012).  The error is that the field "m_previewService" is no longer found using Reflection.

            Const Flags As System.Reflection.BindingFlags = System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.Instance

    'the line below returns a null reference

            Dim m_previewService As System.Reflection.FieldInfo = ReportViewer1.LocalReport.GetType().GetField("m_previewService", Flags)

    This code worked fine in VS 2010.  Can anyone tell us how to disable the PDF export option or how to get the code above to work?

    Thanks for your assistance.

    Monday, October 8, 2012 9:27 PM

All replies