Sajid Hussain

Sajid Hussain

  • 1.2k
  • 514
  • 100.6k

HOW get rdlc in pdf

Mar 30 2015 6:55 AM
i want to get only pdf format of rdlc report using following code.
Hide Copy Code
protected void ReportViewer2_Load(object sender, EventArgs e) 
{
string exportOption = "Word";
 string exportOption1 = "Excel";
RenderingExtension extension = ReportViewer2.LocalReport.ListRenderingExtensions()
.ToList().Find(x => x.Name.Equals(exportOption, StringComparison.CurrentCultureIgnoreCase));
 if (extension != null)
{
 System.Reflection.FieldInfo fieldInfo
= extension.GetType().GetField("m_isVisible",
 System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
fieldInfo.SetValue(extension, false);
}
RenderingExtension extension1 = ReportViewer2.LocalReport.ListRenderingExtensions()
.ToList().Find(x => x.Name.Equals(exportOption1, StringComparison.CurrentCultureIgnoreCase));
 if (extension1 != null)
 {
System.Reflection.FieldInfo fieldInfo1 = extension1.GetType().GetField("m_isVisible",
 System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
fieldInfo1.SetValue(extension1, false);
}
}
problem is that when i use "PDF" then its hide the PDF format from the dropdownlist ,but not working with excel or word??plz guide

Answers (1)