I. Overview
1. Introduction of JavaScript
JavaScript is an interpreted scripting language, mainly used to add interactive behavior to HTML pages. It can be directly embedded in an HTML page, or it can be written as a separate JS file. With the support of most browsers, it can run on multiple platforms, such as Windows, Linux, Mac, etc.
It is an object and event-driven programming language that can directly respond to user input without going through a Web service program, that is, the JavaScript source code does not need to be compiled before being sent to the client, but the character code in text format sent to the client is directly interpreted and executed by the browser.
It responds to user input in an event-driven manner. The so-called event-driven refers to actions generated by performing certain operations on the homepage, such as clicking the mouse, moving windows, selecting menus, etc. When the action occurs, it may cause corresponding event responses.
2. How to use in FineReport
FineReport is a pure Java software, and the reports produced are pure HTML display. Each template will correspond to an HTML document on the browser side when previewing. As an HTML document, you can modify the content of the document or add content through JavaScript or CSS. Therefore, when creating a template, you can modify the presentation content of the report or add some interactive special effects by adding JavaScript code or referencing CSS.
As shown in the figure below, after the submission is successful, the "Print" and "Export" functions of the toolbar are unavailable.
In FineReport, JavaScript code is added to the template by adding events. As shown in the figure below, a "Data Entry Successful" event is added to the template, thus realizing the function in the figure above.
II. Index
When adding events, in addition to JavaScript's own syntax, FineReport also provides some JS-related API interfaces, you can refer to:API Documentation, or refer to the related documents that introduce interfaces in this directory.
For related usage methods or interface summary class introduction, please refer to the following link.