Search results

Toolbar Customization

You can hide the component toolbar to show customized user interface or customize the toolbar icons and element’s appearances using the templates and Report Viewer properties.

In this tutorial, the sales-order-detail.rdl report is used and it can be downloaded from here. You can add the reports from the Syncfusion installation location. For more information, refer to Samples and demos.

Hide parameter block and toolbar items

To hide toolbar items, set the toolbar-settings property. The following code can be used to remove the parameter option from the toolbar and hide the parameter block.

The following code example demonstrates how to hide the parameter block in the Report Viewer at client side.

    <sf-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" toolbar-settings="ViewBag.toolbarSettings">
    </sf-report-viewer>

The following code example demonstrates how to hide the parameter block in the Report Viewer at server side.

       public ActionResult Index()
        {
            ViewBag.toolbarSettings = new Syncfusion.Reporting.Models.ReportViewer.ToolbarSettings();
            ViewBag.toolbarSettings.Items = Syncfusion.Reporting.ReportViewerEnums.ToolbarItems.All
                                               & ~Syncfusion.Reporting.ReportViewerEnums.ToolbarItems.Parameters;
            return View();
        }

Similarly, you can show or hide all other toolbar options with the help of toolbarSettings.Items enum.

Hide toolbar

To hide the Report Viewer toolbar, set the ShowToolbar property to false.

The following code example demonstrates how to hide the toolbar in the Report Viewer at client side.

    <sf-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" toolbar-settings="ViewBag.toolbarSettings">
    </sf-report-viewer>

The following code example demonstrates how to hide the toolbar in the Report Viewer at server side.

       public ActionResult Index()
        {
            ViewBag.toolbarSettings = new Syncfusion.Reporting.Models.ReportViewer.ToolbarSettings();
            ViewBag.toolbarSettings.ShowToolbar = false;
            return View();
        }

Decide or hide the export option

The Report Viewer provides the ExportOptions property to show or hide the default export types available in the component. The following code hides the HTML export type from the default export options.

The following code example demonstrates how to decide or hide the export option in the Report Viewer at client side.

    <sf-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" export-settings="ViewBag.exportSettings">
    </sf-report-viewer>

The following code example demonstrates how to decide or hide the export option in the Report Viewer at server side.

    public ActionResult Index()
    {
        ViewBag.exportSettings = new Syncfusion.Reporting.Models.ReportViewer.ExportSettings();
        ViewBag.exportSettings.ExportOptions = Syncfusion.Reporting.ReportViewerEnums.ExportOptions.All
                                            & ~Syncfusion.Reporting.ReportViewerEnums.ExportOptions.Html;
        return View();
    }