Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Disabling export options in SSRS viewer

Author  Topic 

itmanager8815
Starting Member

3 Posts

Posted - 2012-10-10 : 08:17:27
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.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-11 : 00:26:39
you can tweak rendering formats in report.config

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

itmanager8815
Starting Member

3 Posts

Posted - 2012-10-11 : 14:17:10
Thank you for your response.

Would you be able to provide some examples as to how this can be done? For example, let's say we did not want the PDF export format to appear when exporting.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-11 : 15:47:00
see

http://msdn.microsoft.com/en-us/library/ms156281.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

itmanager8815
Starting Member

3 Posts

Posted - 2012-10-12 : 17:50:39
Thanks. This will also not work for us as we are using Local Mode processing to run the reports and do not have access to Report Server.
Go to Top of Page
   

- Advertisement -