Waiting for reply. Please give solution asap. 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 System.Reflection.BindingFlags Flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance;

      'the line below returns a null reference

            System.Reflection.FieldInfo m_previewService = viewer.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

    • Edited by RetCharles Wednesday, July 10, 2013 1:22 PM
    Wednesday, July 10, 2013 1:08 PM