I make use of a ReportView component in a VB.Net 2005 app. How can I disable the PDF export functionality, only keeping the MS Excel format?
I had exactly the same problem and solved using the following C# method, found here!:
public void DisableUnwantedExportFormat(ReportViewer ReportViewerID, string strFormatName)
{
FieldInfo info;
foreach (RenderingExtension extension in ReportViewerID.LocalReport.ListRenderingExtensions())
{
if (extension.Name == strFormatName)
{
info = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);
info.SetValue(extension, false);
}
}
}
and on the page_load:
DisableUnwantedExportFormat(ReportViewer1, "PDF");