Page 1 of 1

Disable Export option in report viewer

Posted: Mon Sep 20, 2010 4:46 pm
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

Disable Export option in report viewer

Posted: Mon Sep 20, 2010 5:20 pm
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

Disable Export option in report viewer

Posted: Mon Sep 20, 2010 10:37 pm
by Andrew
Hello,

Great!