How can I disable the Excel export option when I generate a report, via the ReportViewer, in my winforms application?
ADDITION:
In particular, I want to hide the toolbar button that refers to Excel output/export task, and not .the one that handles to the pdf export option.
While on the face of it this seems easy, the export options are difficult to get hold of. You can get the toolstrip of the reportviewer by simply doing this:
…and you can iterate through the .Items collection to do what you like with the buttons, however the DropDownItems collection for the export button always appears empty.
So the easy solution is to get rid of the default export button and add your own with just the functionality you need. So in your form constructor:
Then all you need to do is to take care of the actual exporting: