Articles in this section

How to Hide the Page Orientation Option in Bold Reports

Published:
Updated:

This article explains how to hide the Page Orientation option in the Page Settings dialog of the Bold Reports Report Viewer. By disabling this option, you can prevent users from switching between Portrait and Landscape orientations, ensuring that the report layout remains consistent with its intended design.

Step-by-Step Instructions

To hide the Page Orientation option, configure the pageSettings property when initializing the Bold Reports Report Viewer.

Step 1: Configure the Report Viewer

  1. Locate the initialization code for your Report Viewer instance (for example, $("#reportviewer")).
  2. Add the pageSettings object to the Report Viewer configuration.
  3. Set the hidePageOrientation property to true.
$(function () {
    $("#reportviewer").boldReportViewer({
        // The service URL for the Report Viewer
        reportServiceUrl: "https://demos.boldreports.com/services/api/ReportViewer",
        // The report path to load (RDL - Report Definition Language)
        reportPath: '~/Resources/docs/sales-order-detail.rdl',
        // Configuration to hide orientation in Page Settings
        pageSettings: {
            hidePageOrientation: true
        }
    });
});

The hidePageOrientation property is set to false by default. When set to true, the Orientation section is removed from the Page Settings dialog, preventing users from changing the page orientation.

Verify the Behavior

Default Behavior

By default, the Page Settings dialog displays the Orientation section, allowing users to switch between Portrait and Landscape modes.

The Page Settings dialog showing the Orientation selection section.

Modified Behavior

After setting the hidePageOrientation property to true, the Orientation section is hidden from the Page Settings dialog.

The Page Settings dialog with the Orientation section hidden.

Download the sample application from here.

Related Articles

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