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
close icon
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

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