Disable Export option in report viewer

Stimulsoft Reports.NET discussion
Post Reply
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Disable Export option in report viewer

Post by TGoertler »

Hello,

I tried to disable some export formats in the the report viewer.

It works perfectly but I cannot disable the "document file" type (mdc/mdz/mdx file format). Is this possible?

Currently I use the follwing code (VB.NET 2008):

Code: Select all

Dim Services As Stimulsoft.Base.Services.StiServiceContainer = Stimulsoft.Report.StiConfig.Services.GetServices(GetType(StiExportService))
        For Each Service In Services
            If Service.GetType Is GetType(StiBmpExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiCsvExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiDbfExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiDifExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiEmfExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiExcel2007ExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiExcelExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiExcelXmlExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiGifExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiHtmlExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiJpegExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiMhtExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiOdsExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiOdtExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiPcxExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiPdfExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiPngExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiPpt2007ExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiRtfExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiSvgExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiSvgzExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiSylkExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiTiffExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiTxtExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiWord2007ExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiXmlExportService) Then Service.ServiceEnabled = False
            If Service.GetType Is GetType(StiXpsExportService) Then Service.ServiceEnabled = False
        Next
TGoertler
Posts: 24
Joined: Wed Aug 25, 2010 9:16 am
Location: Gundelsheim/Germany

Disable Export option in report viewer

Post by TGoertler »

Ok, after some more research I found the richt place to disable it:

Code: Select all

StiOptions.Viewer.Windows.ShowSaveDocumentFileButton = False
StiOptions.Viewer.Windows.ShowSendEMailDocumentFileButton = False
:D
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Disable Export option in report viewer

Post by Andrew »

Hello,

Great!
Post Reply