in report viewer you can choose pdf, xps, xls and xlsx, but our customer only wants to allow pdf.
the AvailableExportFormats is a readonly property. Is there a possibility to restrict allowedexportformats to pdf?
(using reporting 12.2)
Thank you for your post. I have been looking into the functionality that you are trying to achieve and I can suggest removing the items of the ComboBox, used in the XamReportViewer. You can use the loaded event of the XamReportViewer and in the event handler for that event, you can get the ComboBox and remove all the items, except the one that is for exporting in PDF format. I have created a sample application for you, that shows how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Developer Support Engineer
I am just checking if you require any further assistance on the matter.
sorry I've just seen the message today, and I forgot to mention that I'm using ultrareportviewer. Is it the same there?
There is no direct option for filtering the export formats that are shown.
A possible workaround would be to redefine the report viewer's control template and remove the other export formats (assuming you want only the PDF option, this solution currently does not work with the other formats). Please also note that you can still programmatically call the Export() method on the viewer with any of the formats. You can then set the Uri of the modified control template to the property MergedDictionary of the UltraReportViewer control.
Alternatively, you can hide the Export elements from the viewer by setting the xamReportViewer.ToolBarSettings.ExportVisibility property to Visibility.Hidden and have an export command outside of the Report Viewer.