I. Overview
1.1 Problem
In actual work, it is necessary to realize the automatic carousel effect of multiple reports, but it is different from the Automatic page turning and manual switching of charts. The actual effect is shown in the figure below:
1.2 Solution
Using the JavaScript delay function: after the report is loaded, it stays for a certain time and automatically jumps to another report to achieve automatic carousel special effects.
II. Example
2.1 Add event
Open the template GettingStartedEN_1.cpt, click Template>Template Web Attributes>Pagination Preview Settings in the designer menu bar , select "individually set for the template", and add the loading end event, as shown in the following figure:
setTimeout(function(){
window.location="${servletURL}?viewlet=GettingStartedEN_2.cpt";
},3000)
Follow the above steps, continue to add the loading end event and JavaScript code for the GettingStartedEN_2.cpt, the code is as follows:
setTimeout(function(){
window.location="${servletURL}?viewlet=GettingStartedEN_1.cpt";
},3000)
2.2 Preview effect
Save the template, click any template pagination preview , and the report will be switched every 3 seconds. The effect is shown in the figure below: