JavaScript Example

  • Last update:  2021-06-03
  • 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.

    1.gif

    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.

    2.png

    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.

    JS Instruction

    Write JS depend on browser functions

    JS API Overview

    Events in FineReport

    JS Applications

    FineReport Widget CSS Style

    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy