Articles in this section
Category / Section

Detect and Handle the Preview Button Click Event in Bold Reports Designer

Published:
Updated:

This guide explains how to implement the previewReport event to customize the Preview button click behavior in the Bold Reports Designer. This allows you to execute custom logic when the Preview button is clicked.

Steps to Customize the Preview Button

  1. Bind the previewReport Event
  • Add the following code to your HTML file to bind the previewReport function to the previewReport event:
function App() {
 return (
   <div style={designerStyle}>
           <BoldReportDesignerComponent
           id="reportdesigner_container"
           serviceUrl={'https://demos.boldreports.com/services/api/ReportingAPI'}
            previewReport = {previewReport}>
           </BoldReportDesignerComponent>
   </div>
 );
}

export default App; 
Code Description
previewReport={previewReport} Binds the previewReport function to the Preview button click event in the Bold Reports Designer component.
  1. Implement the previewReport Function
  • Define a custom function previewReport to handle the event triggered when the Preview button is clicked:
function previewReport() {
      alert("Preview Options Clicked");
    } 
Code Description
function previewReport() { alert("Preview Options Clicked"); } Defines the previewReport function that triggers an alert when the Preview button is clicked.

You can replace the alert() function with your own logic to perform specific actions when the Preview button is clicked.

Preview

image.png

Conclusion

By following these steps, you can effectively capture and handle the Preview button click event in your Bold Reports Designer application.

Download the sample application 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