I. Overview
1) Expected effect
How to embed reports in iframe? The effect is shown below:
2) Implementation roadmap
Add a click event to the button widget, add an Iframe pop-up and embed the template in it, and use remoteServletURL to get the template path.
II. Example
1) Adding button widgets
Create a general report, click Widget Settings in the right property panel, and add a button widget named click pop-up box. As shown below:
2) Add click events
Select the button widget and click Widget Settings in the right property panel. Event, add click Event, click the button to preview the"GettingStartedEN. cpt" template in the popover. Add the cc parameter, whose value is expressed as remoteServletURL, to get the template path. As shown below:
The JavaScript is shown below:
var iframe = $("<iframe id='inp' name='inp' width='100%' height='100%' scrolling='yes' framedorder='0'>");
iframe.attr("src", cc+"?reportlet=GettingStartedEN.cpt");
var o = {
width : 700,
height: 500
};
FR.showDialog("添加", o.width, o.height, iframe,o);
3) Effect preview
Save the report and click Data Entry Preview. The effect is as shown in Section I.
Note: Mobile terminal is not supported
III. Download the template
See: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\\doc-EN\Parameter\JS_implementation_dialog_box_to_open_the_report.cpt
Click to download the template:
JS_implementation_dialog_box_to_open_the_report.cpt