Overview
Version
Report Server Version | Plugin Version | Functional Change |
11.0 | 1.0.0 | / |
11.0.10 | 1.1.16 | 1. Changed the plugin name into Large Dataset Export Plugin. 2. Allows exporting CSV files. |
Application Scenarios
Exporting a large amount of data may cause pressure for the server, network, and databases. To prevent such risks, FineReport provides the Large Dataset Export plugin, which allows export data based on dataset results.
Functions
Large Dataset Export plugin allows exporting Excel files through streaming export in the backend with fewer resources and higher speed and without displaying data.
With the Large Dataset Export plugin, you can customize the export event of large datasets and directly export data without calculations.
The implementation procedure is as follows:
1. Use SXSSFWorkbook for quick streaming export.
2. Use one thread to get data and store the data rows in queues, and another thread to read the data rows and export them.
Notes
1. This function is only applicable to relational databases, and you need to set the cursor of SQL Server database to the server cursor.
2. This function does not allow exporting null whose data type is date or datetime. Add the zeroDateTimeBehavior=convertToNull parameter to the end of the URL of JDBC data connection. Oracle data requires no modification.
3. If there are multiple parameters in a template, and you need to set parameters when exporting, set all the parameters. If only some parameters are set, the data cannot be exported.
4. The recommended export data size is less than 10 million rows * 20 columns, otherwise the exported data may not be complete.
5. Data in the exported Excel is directly obtained from databases through SQL statements, rather than the data in reports. Therefore, the data formats set in the reports cannot be exported.
6. This function is not applicable to mobile terminals.
7. In the plugin of V 1.1.10 and later versions, a progress bar will be provided if the export time exceeds five seconds.
8. The plugin supports stored procedure only in the following way.
Plugin Introduction
Installing the Plugin
Click to download the plugin: com.fr.plugin.largedatasetexcelexport.v10-1.1.18.zip
For details about installing designer plugins, see Designer Plugin Management.
For details about installing server plugins, see Server Plugin Management.
Plugin Introduction
After installing the plugin, add the Large Dataset Export event to Widget Setting > Event.
The setting items and their functions are described in the following table.
Setting Item | Introduction | Notes |
File Name |
|
|
Export Format |
| / |
Dataset |
| / |
Parameter |
|
|
Export Column |
|
|
Example One: Exporting Fixed Parameter Value Through Large Dataset Export Plugin
Setting the Template
Open the GettingStarted.cpt template in the reportlets folder under the %FR_HOME%\webroot\WEB-INF directory.
Edit the parameter pane, add a Button widget, and modify Widget Name and Button Name to Export.
Setting Widget Event
Select the Export button, choose Widget Setting > Event > Add Event, and set the event type to Large Dataset Export.
The setting items are described in the following figure.
· File Name: Export Example One
· Format: Excel
· Dataset: ds1
· The type of the Region parameter is String, and the value is California.
· Export Column: Region, Salesperson, and Product Type
Demonstration
Save the template, click Pagination Preview, and click the Export button to export the Export Example One file whose region is California.
Example Two: Exporting Dynamic Parameter Value Through Large Dataset Export Plugin
Setting the Template
Open the GettingStarted.cpt template in the reportlets folder under the %FR_HOME%\webroot\WEB-INF directory.
Edit the parameter pane, add a Button widget, and modify Widget Name and Button Name to Export.
Setting Widget Event
Select the Export button, choose Widget Setting > Event > Add Event, and set the event type to Large Dataset Export.
The setting items are described in the following figure.
· File Name: Export Example Two
· Format: Excel
· Dataset: ds1
· The type of the Region parameter is Formula, and the value is $region. In this case, the exported parameter value is determined by another parameter widget.
· Export Column: Region, Salesperson, and Product Type
Demonstration
Save the template, and click Pagination Preview. The exported parameter values in Excel are determined by the parameter values of the drop-down box widget.
Select California in the drop-down box to export the Export Example Two file whose region is California.