Overview
Triggering an event will trigger the corresponding response. Therefore, adding an event requires selecting an appropriate event response method, as shown in the following figure.

FineReport offers seven event response methods: JavaScript, Submit to Database, Send Email, Export Event, Mobile Pop-up, Submission Event, and Custom Event. The following table describes each response method.
| Response Method | Description |
|---|---|
JavaScript | When the event is triggered, JavaScript code is executed. This is the most commonly used response method. |
Submit to Database | When the event is triggered, data is submitted to the database, which is similar to the built-in SQL submission configured in Data Entry Attribute. |
Send Email | When the event is triggered, an email is sent. To use the function, you must configure a sending email address on the decision-making platform. |
Export Event | When the event is triggered, the specified template is exported to a file of a specific type, such as Excel and Word. |
Mobile Pop-up | When the event is triggered, a hyperlinked template or text annotations are displayed in a pop-up box. The response method can only be used on mobile terminals. |
Submission Event | When the event is triggered, data is submitted to the database, which is similar to the built-in SQL submission configured in Data Entry Attribute. |
Custom Submission | When the event is triggered, data submission is implemented through a custom backend class. |
Method Description
JavaScript
As the most commonly used response method, JavaScript is typically employed for real-time user interactions, such as immediate validation and dynamic value assignment. When the event is triggered, JavaScript code is executed, as shown in the following figure.
For details about the JavaScript setting page, see JavaScript.

Submit to Database
The Submit to Database event refers to submitting data to the database. This response method is similar to data entry submission, except that the submission is executed only after the event is triggered, as shown in the following figure.
The Submit to Database event allows you to add multiple submission conditions, similar to how multiple submission conditions are set in Data Entry Attribute. For details, see Built-in SQL Submission.
Compared to data entry submission, the Submit to Database event includes the additional function of Set Callback Function. Set Callback Function provides an entry point for defining interactions after a submission, whether successful or failed. For details, see Customizing Prompts in the Callback Function by JS.

Send Email
When the event is triggered, an email is sent. After selecting Send Email as the response method, you can configure the email recipient, content, and other information as needed, as shown in the following figure.
Note that to use this function, you must configure a sending email address on the decision-making platform. For details, see Mailbox.
For details about an email sending example, see Email Notification upon Successful Data Entry.

Export Event
When the event is triggered, the specified template is exported to a file of a specific type, such as Excel and Word. The following figure shows the configuration items of Export Event, including Export Template, Export Way, and Export File Name.
Note: For details about the application example, see Custom Export File Name.

Mobile Pop-up
When the event is triggered, a hyperlinked template or text annotations are displayed in a pop-up box. The response method can only be used on mobile terminals. You can configure the template and text annotations displayed in the pop-up box here, as shown in the following figure.
For details, see [General] Mobile Pop-Up.

Submission Event
Submission Event, used for data entry templates, is configured in Set Submission Event under Template> Data Entry Attribute > Built-in SQL, as shown in the following figure.
It is similar to the built-in SQL submission configured in Data Entry Attribute. For details, see Built-in SQL Submission.

Custom Event
Custom Event, used for data entry templates, is configured in Set Submission Event under Template> Data Entry Attribute > Built-in SQL, as shown in the following figure.
It is similar to the built-in SQL submission configured in Data Entry Attribute. For details, see Built-in SQL Submission.
