Articles in this section

How to hide the Finish Button in the Bold Reports Query Designer

Published:
Updated:

In the Bold Reports Dataset Designer, you can hide the Finish button. This can be useful when you want to simplify the user interface or guide users through a specific workflow. This article explains how to hide the button using CSS and remove it from the DOM using JavaScript, helping prevent the button from appearing even when the designer updates its UI dynamically.

Important: Hiding or removing a button from the browser UI is not a security feature and does not enforce access control. If users must be prevented from performing an action, the server must enforce the appropriate permissions and validations.

Step-by-Step Instructions

  1. Hide the Finish Button from the User Interface Using CSS
    Add the following CSS to your application stylesheet, or place it inside a <style> block in the page that hosts the designer.
#container #container_toolbar_data_btn_save,

[id="container"] [id$="_toolbar_data_btn_save"] {
 display: none !important;
 visibility: hidden !important;
 pointer-events: none !important;
} 

This CSS targets the Finish button in the wizard toolbar and hides it from the user interface. The implementation relies on specific element IDs and selectors generated by the designer and may require updates after upgrading to newer versions of Bold Reports.

  1. Remove the Finish Button from the DOM Using JavaScript
    Because the Designer loads some components dynamically, CSS alone may not be sufficient if the button is reinserted into the page. Use a MutationObserver to detect and remove the button whenever it appears.

  2. Add the following script to your page after initializing the Web Designer:

(function hardDisableFinishButton() {
 const container = document.getElementById('container');
 if (!container) return;

 // Utility function to remove the button if found
 function nukeFinishBtn(root = document) {
   // Target by exact ID first
   const byId = root.querySelector('#container_toolbar_data_btn_save');
   if (byId) {
     byId.remove();
     return;
   }
   
   // Fallback: detect by ID suffix pattern and visible text "Finish"
   const candidates = root.querySelectorAll('[id$="_toolbar_data_btn_save"], button.e-rptdesigner-btn');
   candidates.forEach(btn => {
     const txt = (btn.textContent || '').trim();
     if (txt === 'Finish') {
       btn.remove();
     }
   });
 }

 // Initial pass to remove the button if it exists
 nukeFinishBtn(container);

 // Use MutationObserver to watch for dynamic inserts (e.g., when opening data wizards)
 const observer = new MutationObserver(muts => {
   for (const m of muts) {
     if (m.type === 'childList') {
       m.addedNodes.forEach(node => {
         if (node.nodeType === 1) { // Ensure it is an element node
           nukeFinishBtn(node);
         }
       });
     }
   }
 });

 observer.observe(container, { childList: true, subtree: true });
})(); 

Step 3: Verify the Implementation

  1. Run your application and open the Bold Reports Web Designer.

  2. Navigate to the Data pane and create or edit a dataset.

  3. Verify that the Finish button is no longer visible in the wizard toolbar.

  4. Use your browser’s developer tools (F12) to confirm that the button element has been removed from the DOM.

    image.png

Download the above sample application from here.

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