ReportViewer 2010:how to hide pdf in export option in reportviewer

please help me out 
how shoul i hide pdf in export option in reportviewer
susana w

Hi,
This is the code which is used for ReportViewer 2008 and i need code for ReportViewer 2010. I don't want to change in the reportserver's RSReportSErver.Config
file because same report server we are using for different projects where in some projects we require pdf and some we do not. Below is the code for reportviwer 2008 where the export button is rendered as a dropdown and in reportviwer 2010, Export button is
redered as div element and all the export options like pdf,word,etc elements are rendered as div elements . So in code behind how can i access these export button options?
   private void CustomizeReportViewer(System.Web.UI.Control reportControl)
            foreach (System.Web.UI.Control childControl in reportControl.Controls)
                if (childControl.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                    System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)childControl;
                    if (ddList.ToolTip.Contains("Export"))
                        ddList.PreRender += new EventHandler(ddList_PreRender);
                if (childControl.GetType() == typeof(System.Web.UI.WebControls.Button))
                    System.Web.UI.WebControls.Button ddList = (System.Web.UI.WebControls.Button)childControl;
                    if (ddList.UniqueID.Contains("ctl00_ContentPlaceHolder1_rptviewerByBrandBySentimentAttribute_ctl06_ctl04_ctl00_Button"))
                        ddList.PreRender += new EventHandler(ddList_PreRender);
                if (childControl.Controls.Count > 0)
                    CustomizeReportViewer(childControl);
        // This is the event handler added from CustomizeRV 
        // We just check the object type to get what we needed. 
        // Once the dropdownlist is found, we check if it is for the ExportGroup. 
        // Meaning, the "Excel" text should exists. 
        // Then, just traverse the list and disable the "Excel". 
        // When the report is shown, "Excel" will no longer be on the list. 
        // You can also do this to "PDF" or if you want to change the text. 
        void ddList_PreRender(object sender, EventArgs e)
            if (sender.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)sender;
                System.Web.UI.WebControls.ListItemCollection listItems = ddList.Items;
                if ((listItems != null) && (listItems.Count > 0) && (listItems.FindByText("Excel") != null))
                    foreach (System.Web.UI.WebControls.ListItem list in listItems)
                        if (list.Text.Equals("XML file with report data") || list.Text.Equals("CSV (comma delimited)") || list.Text.Equals("TIFF file") || list.Text.Equals("Word") || list.Text.Contains("PPS"))
                            list.Enabled = false;

Similar Messages

  • ReportViewer 2010:how to hide pdf in export option in subreports in reportviewer

    Hi,
    I am using ReportViewer 2010 and using code (posted below) to hide certain options from export, its working fine for parent report,  but when i am clicking on parent report to view child report, then export option in child report is showing all the
    items in export option which all are hided in parent report. So please help me out.
    private void DisableUnwantedExportFormats()
                FieldInfo info;
                foreach (RenderingExtension extension in rptviewerByBrandBySentimentAttribute.ServerReport.ListRenderingExtensions())
                    if (extension.Name != "PDF" && extension.Name != "ASPPT" && extension.Name != "ASPPTX" && extension.Name != "EXCEL" && extension.Name != "MHTML") // only PDF and Excel
    - remove the other options
                        info = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);
                        info.SetValue(extension, false);
                    if (extension.Name == "ASPPT") // change "Excel" name on the list to "Excel 97-2003 Workbook"
                        info = extension.GetType().GetField("m_localizedName", BindingFlags.Instance | BindingFlags.NonPublic);
                        if (info != null) info.SetValue(extension, "PowerPoint 2003");
                    if (extension.Name == "ASPPTX") // change "Excel" name on the list to "Excel 97-2003 Workbook"
                        info = extension.GetType().GetField("m_localizedName", BindingFlags.Instance | BindingFlags.NonPublic);
                        if (info != null) info.SetValue(extension, "PowerPoint 2007");
    neha

    Hi,
    Thank you for this article.
    I am using the localreport ReportViewer 2010 and other code examples weren't working.
    Apparently, the m_isVisible field was not available in earlier version of ReportViewer
                        info = extension.GetType().GetField("m_isVisible", BindingFlags.Instance | BindingFlags.NonPublic);                    info.SetValue(extension, false);
    Code that wasn't working:
                FieldInfo info = extension.GetType().GetField("m_serverExtension",            BindingFlags.NonPublic | BindingFlags.Instance);            if (info != null)            {                object actualExtension = info.GetValue(extension);                if (actualExtension != null)                {                    PropertyInfo propInfo = actualExtension.GetType().GetProperty("Visible");                    if (propInfo != null && propInfo.CanWrite)                    {                        propInfo.SetValue(actualExtension, false, null);                    }                }            }
    Thanks again, chupaul :)

  • How to hide pdf in export option in ssrs ReportViewer

    Hi,
    This is the code which is used for ReportViewer 2008 and i need code for ReportViewer 2010.
    so please help me out asap.
       private void CustomizeReportViewer(System.Web.UI.Control reportControl)
                foreach (System.Web.UI.Control childControl in reportControl.Controls)
                    if (childControl.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                        System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)childControl;
                        if (ddList.ToolTip.Contains("Export"))
                            ddList.PreRender += new EventHandler(ddList_PreRender);
                    if (childControl.GetType() == typeof(System.Web.UI.WebControls.Button))
                        System.Web.UI.WebControls.Button ddList = (System.Web.UI.WebControls.Button)childControl;
                        if (ddList.UniqueID.Contains("ctl00_ContentPlaceHolder1_rptviewerByBrandBySentimentAttribute_ctl06_ctl04_ctl00_Button"))
                            ddList.PreRender += new EventHandler(ddList_PreRender);
                    if (childControl.Controls.Count > 0)
                        CustomizeReportViewer(childControl);
            // This is the event handler added from CustomizeRV 
            // We just check the object type to get what we needed. 
            // Once the dropdownlist is found, we check if it is for the ExportGroup. 
            // Meaning, the "Excel" text should exists. 
            // Then, just traverse the list and disable the "Excel". 
            // When the report is shown, "Excel" will no longer be on the list. 
            // You can also do this to "PDF" or if you want to change the text. 
            void ddList_PreRender(object sender, EventArgs e)
                if (sender.GetType() == typeof(System.Web.UI.WebControls.DropDownList))
                    System.Web.UI.WebControls.DropDownList ddList = (System.Web.UI.WebControls.DropDownList)sender;
                    System.Web.UI.WebControls.ListItemCollection listItems = ddList.Items;
                    if ((listItems != null) && (listItems.Count > 0) && (listItems.FindByText("Excel") != null))
                        foreach (System.Web.UI.WebControls.ListItem list in listItems)
                            if (list.Text.Equals("XML file with report data") || list.Text.Equals("CSV (comma delimited)") || list.Text.Equals("TIFF file") || list.Text.Equals("Word") || list.Text.Contains("PPS"))
                                list.Enabled = false;
    susana w

    Hi God’s Favorite,
    Thanks for your post.
    According to your description, you would like to disable the SSRS rendering format PDF in VS 2010 ReportViewer control, please
    refer to the steps below I demonstrate for you:
    1. Add the method below to your .aspx.cs file as back-end code.
    /// <summary>
    /// Hidden the special SSRS rendering format in ReportViewer control
    /// </summary>
    /// <param name="ReportViewerID">The ID of the relevant ReportViewer control</param>
    /// <param name="strFormatName">Format Name</param>
    public void DisableUnwantedExportFormat(ReportViewer ReportViewerID,
    string strFormatName)
    FieldInfo info;
    foreach (RenderingExtension extension
    in ReportViewerID.ServerReport.ListRenderingExtensions())
    if (extension.Name == strFormatName)
    info = extension.GetType().GetField("m_isVisible",
    BindingFlags.Instance |
    BindingFlags.NonPublic);
    info.SetValue(extension, false);
    2. Choose the relevant Reportviewer control and press F4.
    3.  In the Properties window, click the Events icon, then double click the PreRender item to generate the
    ReportViewer1_PreRender method, I assume your reportViewer control ID is ReportViewer1,
    edit your method like below:
    protected void ReportViewer1_PreRender(object sender,
    EventArgs e)
    DisableUnwantedExportFormat((ReportViewer)sender,"PDF");
    After you complete the steps above, run your project and it works just as you expected.
    Thanks,
    Bill Lu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • How to hide Print and Filter option from dynamic ALV

    Hi,
    I have created the dynamic ALV. now User don't wan't Filter , export,print Option on the ALV dispaly.
    Could you please tell me How to hide Print and Filter option from dynamic ALV.
    Thanks and regards
    Amita.

    Hi,
    Please go through the following link to get an better idea on ALV.
    [https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9&overridelayout=true]
    This is the code  which you have to write in  WDDOINIT
    DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
    LO_CMP_USAGE =   WD_THIS->WD_CPUSE_ALV_TEST( ).
    IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
      LO_CMP_USAGE->CREATE_COMPONENT( ).
    ENDIF.
    DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
          LO_INTERFACECONTROLLER =   WD_THIS->WD_CPIFC_ALV_TEST( ).
            DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
            LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
    lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_EXPORT_ALLOWED( abap_false ).
    lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_PDF_ALLOWED( abap_false ).
    lo_value->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( abap_false ).

  • How to hide PDF toolsbar

    I want the pdf always startup with defaulted hide the toolsbar(e.g hand tool, zoom tool, select tool...).
    Can any expert guide me?
    Below is my existing souce code.
    i using the "cl_gui_html_viewer" to call the pdf application
    cause i need to convert the OFT(smartform) to pdf and load the data using URL.
      DATA: l_url(2048) TYPE c.
      DATA: html_alignment TYPE I.
      DATA: BEGIN OF html_control,                              " PEOPLE CARD CONTAINER
             container    TYPE REF TO cl_gui_custom_container,
             control      TYPE REF TO cl_gui_html_viewer,
            END OF html_control.
      CONSTANTS : BEGIN OF c,
                   align_at_left           TYPE i VALUE 1,
                   align_at_right          TYPE i VALUE 2,
                   align_at_top            TYPE i VALUE 4,
                   align_at_bottom         TYPE i VALUE 8,
                 END OF c.
      IF html_control-container IS INITIAL.
        CREATE OBJECT html_control-container              " CREATE CONTAINER
            EXPORTING
                container_name = 'PDF_CONTAINER'
            EXCEPTIONS
                others = 0.
      ENDIF.
      IF html_control-control IS INITIAL.
        CREATE OBJECT html_control-control                 " ASSIGN CONTAINER TO CONTROLER
             EXPORTING
                  parent = html_control-container.
        IF sy-subrc = 0.
          html_alignment = c-align_at_left + c-align_at_right
                           + c-align_at_top + c-align_at_bottom.
          CALL METHOD html_control-control->set_alignment  " SET ALIGNMENT
            EXPORTING
              alignment = html_alignment.
        ENDIF.
      ENDIF.
      CALL METHOD html_control-control->load_data           " GET PDF URL
        EXPORTING
          type         = 'APPLICATOIN'
          subtype      = 'PDF'
        IMPORTING
          assigned_url = l_url
        CHANGING
          data_table   = t_lines_pdf
        EXCEPTIONS
          OTHERS       = 1.
      CALL METHOD html_control-control->show_data           " SHOW PDF
        EXPORTING
          url = l_url.
      IF SY-SUBRC = 0.
        MOVE 'X' TO w_flag-load_pdf.
      ENDIF.

    hi
    good
    go through these link,this ll give you brief idea about cl_gui_html_viewer,check them and do the changes in your program accordingly.
    http://www.sap-basis-abap.com/abap/example-of-sap-html-viewer-to-browse-the-internet.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/147a36c70d2354e10000009b38f839/frameset.htm
    thanks
    mrutyun^

  • How to restrict 'Broadcast and Export' option of BW report through web.

    Helllo,
    Please anyone let me know, how NOT to give/allow "Broadcast and Export' option in BW report, when accessed through Web.
    Is there is any Auhtorization object which restrictes this option.

    Hi,
    Please check this, it may help you.
    http://help.sap.com/saphelp_nw70/helpdata/en/80/1a68b4e07211d2acb80000e829fbfe/frameset.htm
    Regards,
    Madhu

  • How to get pdfs to export or print from Safari?

    I'm having a very serious intermittent problem getting pdf's to print or export from Safari.  Occasionally when I try and open a pdf in the browser I get an error message that Adobe Reader needs to be opened (even if it already is open) and then I need to close out Safari and re-open the link to even see the pdf.  But after that, sometimes when I try to print or export the file, all I get are blank pages.  I've tried having them downloaded or printed as images but that doesn't work either.  It's very frustrating.
    I've tried trashing Adobe Reader and re-installing but to no avail. It's gotten to the point that I often just open Preview and do a screen grab of the pdf's and save them that way.  Not the best workaround.
    Any help would be very much appreciated.
    Macbook Pro
    OSX 10.9
    Safari Version 7.0 (9537.71)
    Adobe Reader  11.0.04

    Yes every time I open the app it makes me accept the EULA or else it won't work as a reader.  That's not the problem. The problem is not being able to print or download the pdf file from the browser after I accept the EULA. Any other suggestions?

  • How to Hide Page View Webpart Option E.g.: Refresh, Open in Visio, Close.

    Hello all- Is there any way to hide Refresh, Open in Visio, Close option from Page Viewer Webpart, using Java script or client side method.
    <script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function()
        $('#VwaToolbarButton').css('display','none');
        $('#VwaRefreshButton').css('display','none');
        $('#VwaButtonNormal').css('display','none');
       

    Hi Kamal,
    As I understand, you want to hide the Refresh, Open in Visio, Close option in the page viewer web part by JavaScript or client side method in SharePoint 2010.
    You could add the custom CSS code to hide the Refresh, Open in Visio, Close option in the page by content edit web part.
     You could use CSS 'visibility: hidden’ or 'display: none’ to hide the buttons.
    You could add the CSS code to content edit web part as below:
    <style type="text/css">
    //your custom css code.
    </style>
    The article below is about CSS syntax.
    http://www.w3schools.com/css/css_syntax.asp
    The article below is about three Ways to Insert CSS.
    http://www.w3schools.com/css/css_howto.asp
    Best regards,
    Sara Fan
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to create new SVG export option

    I need to create a new SVG option to work with exportFile(). The new option will allow me to place a tag on in my exported SVG file. I'm not finding hints in the delivered documentation on how to do this. Could someone with experience in such, please point me to a resource that will help me.
    Thanks in advance.
    Steve

    Hi..
    Its continuous to earlier query, creation of new search help in Personnel Administration, we created elementary search help from SE11, now need to integrate this back end customization to front end screen,
    How to do this.,
    Welcome to all sharing minds.
    Regards.
    Kanuku.

  • How to Hide "Edit in Browser" option in View Mode of SharePoint2013 with WebApps2013

    Hhow to Hide >> "Edit in Browser" in Sharepoint2013 with WebApps2013 screen

    Try and use jQuery to find the respective element and hide it.
    Sairam Avacorp Technologies

  • View PDF after export - grayed out

    I JUST upgraded from CS3 to CS4 and now this box is grayed out in my PDF export options. So I now have to launch the PDF manually instead of it being automatically launched after being created. Am I doing something wrong, or is this option no longer available?

    Well, I guess it was Halloween and some ghosts got into my update because now I am able to choose the "View PDF after Export" option. It was not available when I tried to edit the PDF preset but it's available once I actually use the preset to generate a PDF. Go figure.

  • How to Hide " AUTO Reversal" button on Journal Template

    Hi All
    Can any one please let me know how to hide or not shown option to AUTO REVERSED button  on Jounral template?
    appreiated your help
    Thanks

    Hello,
    I have figured out that this has been requested as an enhancement to the productu2026
    Unfortunately, there is no forecast to know if it will be accept and, if accepted, when it would be implementedu2026
    I know that it has not been what you've been waiting to hear...
    Best regards,
    Vin

  • Hide Personalizse and Details option in webdynpro page

    Hi,
    I have created a page for webdynpro application through SPRO. When I open a page in portal, i'm able to see Personalize and Details options.
    How to hide personalize and details options in Options for webdynpro iview/page.
    Thanks for your advice.
    Regards
    Vasundhara

    Hi Vasundara
    1) Login into Portal as Administrator
    2)Contenet Adminsitrator
    3)Portal Content
    4)Navigate to the page for which you want to change the options
    5)Open the page in <b>Object</b> Mode
    6)Goto Appearance Tray in Property Category
    7) Deselect <i><b>Show ''Personalize'' Option</b> </i>and <b><i>Show 'Details' Option</i></b>
    Regards
    Chaitanya.A

  • Automator export option?

    I've got like 20 movies i want to export for the iphone, but the only option in automator is for ipod or appletv. anybody know how to get an iphone export option in there?

    Welcome to the Apple Discussions.
    But invariable, the smaller picture, in full size, is not smooth, and you can see all the pixels.
    By full size do you mean at it's pixel dimensions or enlarged to fill the iPhoto window? When you resize a photo via the Export menu option you're taking the image and reducing the pixels for each dimension by half. If you display that new image at its new size it will look good. If you display that same image full screen or at a size larger than the actual pixel dimensions it will look pixelated and jaggy. You can't take an 800 x 600 pixel image and display it at the same size, say a frame in an iPhoto book, and have it look as good as the original 1600 x1200 pixel file. (If this is not what you're referring to then this post will self destruct in 5 seconds Mr. Phelps.)
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.7)   22 LCD Display, 200G & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

  • How can I digitalize a document text in PDF and export it to WORD?

    Anthony
    How can I digitalize a document text in PDF and export it to WORD?

    If you already have a PDF document, ExportPDF can help you with this task. https://www.acrobat.com/exportpdf/en/convert-pdf-to-word.html
    On the other hand, if you have a physical document, you'll need to scan it into a PDF document first.
    Depending on what you need to do you may require different tools & services, so please help us out with more details.
    Vlad

Maybe you are looking for

  • Help needed  in writing a Query/Procedure

    Hello All, Need all ur help in writing a query or procedure Lets say the Table name is DEMO There i have one column like num it has values 1 2 3 4 5 8 9 10 my query output should be 1-5 8-10 i,e .. if the diff between two rows is greater than 1 then

  • WHY I CAN'T OPEN MY SCRIPT?

    I have been working on my script for several months in Adobe Story Free with no problem, but this week I can not open it at all.  I can't even see it listed.  I only ever access it on one computer and it has never been a problem before. Can someone p

  • Portlets in showOneTab do not function correctly

    Hi! I have created a WebCenter application in JDev 10.1.3. We have some JSF portlets (using JSF Portlet Bridge) and have grouped those on a webcenter page using a showOneTab component. I encounter the following problem: when the portlet contains an A

  • Can't Activate Windows Azure from my BizSpark MSDN account, can you please help?

    Hello there, I have a BIizSpark MSDN account and I am trying to access Windows Azure but it is not allowing me. From MSDN, when I click on "Activate Windows Azure" then I receive a form, there I enter my phone number for mobile verifications, then I

  • Illustrator crashes when opening some PDFs

    When opening some PDFs in Illustrator, Illustrator "Quits Unexpectedly" It only occurs on one out of 15 of our Macs I am running on all the latest updates both OS and Adobe It is very intermittent It only seems to do it across a SMB network share If