Articles in this section

How to Hide the View Report Button in Bold Reports Report Viewer

Published:
Updated:

To hide the View Report button in Bold Reports Report Viewer, use one of two methods. Remove the Parameters item from the viewer’s toolbar settings to hide the button along with the parameter pane. Or apply display: none to the View Report button’s CSS selector to hide only the button and keep the parameters visible.

image.png

When to use this

Use this when you want to stop end users from manually triggering rendering from the parameter panel. There is no dedicated API for hiding the View Report button on its own, so you either remove the whole parameter pane (Method 1) or hide just the button with CSS (Method 2).

Choose based on whether users still need to change parameters:

  • Method 1 removes the parameter pane and the button together. The report then renders from its default parameter values.
  • Method 2 keeps the parameter pane editable and hides only the button.

By doing so, you must pass the default values for all the parameters available in the report.

Steps

Choose one of the two methods below.

Method 1: Hide the button with the parameter pane (toolbar settings)

Use this when you want neither the parameters nor the View Report button to appear.

  1. Bind the viewer to a toolbar-settings object. Add this to index.cshtml:

    <bold-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" toolbar-settings="ViewBag.toolbarSettings">
    </bold-report-viewer>
    
  2. Remove the Parameters item from the toolbar in HomeController.cs. This hides the parameter block, including the View Report button

    public ActionResult Index()
    {
       ViewBag.toolbarSettings = new BoldReports.Models.ReportViewer.ToolbarSettings();
       ViewBag.toolbarSettings.Items = BoldReports.ReportViewerEnums.ToolbarItems.All
       & ~BoldReports.ReportViewerEnums.ToolbarItems.Parameters;
       return View();
    }
    
  3. Save the files and run the application. The report renders with both the parameter pane and the View Report button hidden.

    image.png

Method 2: Hide only the button, keep the parameters (CSS)

Use this when you still want users to see and change parameters, but not the button.

Version note: .e-reportviewer-viewreport is an internal CSS class and not part of the documented public API. Whenever possible, use Method 1, as it relies on the supported toolbar settings API.

  1. Open the CSS file in your application that is responsible for report rendering.

  2. Target the .e-reportviewer-viewreport selector, which controls the View Report button in the current version

  3. Add the following rule:

    .e-reportviewer-viewreport {
        display: none !important;
    }
    
  4. Save the CSS file and reload the application. The parameters stay visible and only the View Report button is hidden.

    image.png

This modification will override the default view of the View Report button and apply the hidden property to the button.

Result

The View Report button no longer appears in the Report Viewer. With Method 1 the whole parameter pane is gone and the report renders from its default parameter values. With Method 2 the parameters remain editable and only the button is hidden.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied