Restricting Export Type for one report and not the others

Stimulsoft Reports.WEB discussion
Post Reply
sdms2020
Posts: 5
Joined: Wed Aug 12, 2020 9:45 am

Restricting Export Type for one report and not the others

Post by sdms2020 »

Currently the project I deploy to my web server has 6 reports in it. The report that runs/displays depends on a case statement which gets a parameter from the URL. If I configure the "ShowExportTo..." options in my default.aspx page then they affect all six of my reports. What I would like to achieve is for one of the reports to only have the option of saving it as a PDF whereas the other five reports I want the option of saving them as PDF, Word and Excel. Lech has mentioned setting these options before loading the reports and that you can refresh the page or reload viewer component for each report. I can't find any examples in the online documentation or videos on how I do this or where I place the code for this. I am a basic coder (VB) and would appreciate some assistance/instructions/code snippet on what I have to do to get this working.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Restricting Export Type for one report and not the others

Post by Lech Kulikowski »

Hello,

Please check the following code in the Page_Load event instead of the GetReport:

Code: Select all

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim path = HttpContext.Current.Server.MapPath("license.key")
        Stimulsoft.Base.StiLicense.LoadFromFile(path)
...
Case "SchoolRecipeBook"
             Dim report = New StiReport()
             report.Load();
             ShowExportToExcel = False
...

Case "SchoolRecipeBook2"
             Dim report = New StiReport()
             report.Load();
             ShowExportToExcel = True
...

    End Sub
Thank you.
Post Reply