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.
Unfortunately, activation email could not send to your email. Please try again.

How to show reports hiding parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

128295 Jan 12,2017 12:19 PM Jan 13,2017 03:53 AM Report Platform 1
loading
Tags: Report Viewer
Daniel Pujante
Asked On January 12, 2017 12:19 PM

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




Yuvaraj Devarajan [Syncfusion]
Replied On January 13, 2017 03:53 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;