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
- Bind the
previewReportEvent
- Add the following code to your
HTMLfile to bind thepreviewReportfunction to thepreviewReportevent:
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. |
- Implement the
previewReportFunction
- Define a custom function
previewReportto 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
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.