We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to show reports hiding parameters

Hi, 

I made a few repots which have parameters, but sometimes, I need to show the reports with the parameter hiding these by code. I've just found the following sentence:


$("#viewer").ejReportViewer({

    toolbarSettings:{

        items: ej.ReportViewer.ToolbarItems.All & ~ej.ReportViewer.ToolbarItems.Parameters

    }

});

It makes that the whole toolbar and parameters disappear, however, I'd like to hide only the parameter so the costumers could click on the buttom parameters when they need to redender the report again without having to leave the report.

I'd be very grateful with you if you could help me.

Thank you very much

Regards,

Daniel Pujante




1 Reply

YD Yuvaraj Devarajan Syncfusion Team January 13, 2017 08:53 AM UTC

Hi Daniel, 

Thanks for contacting Syncfusion support. 

We can able to hide the single parameter in code behind dynamical in OnInitReportOptions method by editing the DOM file as shown in below code example. 

WebAPI: 
public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            Syncfusion.RDL.DOM.ReportDefinition reportDefinition = this.DeSerializeReport(reportOption.ReportModel.ReportPath); 
            foreach (var param in reportDefinition.ReportParameters) 
            { 
                if (param.Name == "HiddenParam") 
                { 
                    param.Hidden = true; 
                }                 
            } 
            reportOption.ReportModel.Stream = GetStream(reportDefinition); 
            reportOption.ReportModel.ReportPath = string.Empty;            
        } 

We have prepared a sample and it can be downloaded from, 

Also in ReporBuider, we have an option to hide the Report parameter in parameter property panel as shown in below screenshot, 

 

Please refer to the below MSDN link for more detail, 

Regards, 
Yuvaraj D. 


Loader.
Live Chat Icon For mobile
Up arrow icon