I am using Report Viewer 10.0.0.0 to view the report in Sql Reporting Service 2008R2.
I want to disable a export(ex:Excel,PDF) of ReportViewer in code behind.
I try some code for Report Viewer 8.0.0.0 like that :
var info = extension.GetType().GetField("m_serverExtension", BindingFlags.NonPublic | BindingFlags.Instance);
if (info != null)
{
var rsExtension = info.GetValue(extension) as OldVer::Microsoft.SqlServer.ReportingServices2005.Execution.Extension;
if (rsExtension != null)
{
rsExtension.Visible = false;
}
//info.SetValue(extension, false);
}
But seem it does work with Report Viewer 10.0.0.0.
Can you please help me a solution to disable a export in Report Viewer 10.0.0.0 ?
I think you should do that through javascript code. Leave ReportViewer to render at a page and analyze the HTML code it generates. Then use jQuery to hide the elements related to Export feature.
Barcode, Labeling, Printing & Imaging tools for ASP.NET Developers
Member
5 Points
27 Posts
How to disable a export in Report Viewer 10.0.0.0
Jul 19, 2013 05:11 AM|Nghianx1987|LINK
Dear all,
I am using Report Viewer 10.0.0.0 to view the report in Sql Reporting Service 2008R2.
I want to disable a export(ex:Excel,PDF) of ReportViewer in code behind.
I try some code for Report Viewer 8.0.0.0 like that :
But seem it does work with Report Viewer 10.0.0.0.
Can you please help me a solution to disable a export in Report Viewer 10.0.0.0 ?
Thank you very much.
Participant
1170 Points
367 Posts
Re: How to disable a export in Report Viewer 10.0.0.0
Jul 19, 2013 07:11 PM|Neodynamic|LINK
I think you should do that through javascript code. Leave ReportViewer to render at a page and analyze the HTML code it generates. Then use jQuery to hide the elements related to Export feature.