How to Hide the Page Orientation Option in Bold Reports
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
- Locate the initialization code for your Report Viewer instance (for example,
$("#reportviewer")). - Add the
pageSettingsobject to the Report Viewer configuration. - Set the
hidePageOrientationproperty totrue.
$(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.
Modified Behavior
After setting the hidePageOrientation property to true, the Orientation section is hidden from the Page Settings dialog.
Download the sample application from here.