I. Overview
1. Application scenarios
Finereport supports copying data from Excel to the data entry page, and then submitting it.
Note: mobile terminal is not supported.
2. Solution
When data entry preview, first add the corresponding number of blank records, and then copy the data in Excel to these blank records.
II. Examples
1. Report design
The report is designed as shown in the figure below.
Add text widgets from A2 to D2
2. Add record
Select data entry preview to open the report, and click the add record button on the toolbar. As many lines need to be copied in Excel, as many blank records need to be added in the browser.
3. Copy data
Select and copy (Ctrl + C) the data in Excel.
4. Paste data
Return to the data entry preview page and paste the data.
Click the cell in the upper left corner of the data and paste when the black box as shown in the figure under II.2 appears (Ctrl + V).
5. Click Submit.
III. Precautions
At present, the null value in Excel cannot be pasted to the data entry page, that is, the null value will be automatically ignored and skipped.
Resolvent:
You can add the loading end event in the designer menu bar Template > Web Attributes > Data Entry Settings (you can import JS file or paste code). At this time, select to set this template separately in the template web properties. Or add the loading end event in Server >Server Configuration > Data Entry settings (import JS file or paste code). At this time, select server settings in the template web properties.
JS code is as follows:
FR.WritePane.prototype.dealWithPasteContent = function(value) {
if (value.endWith('\n')) {
value = value.substring(0, value.length - 1);
}
return this._parsePasteContentToArray(value);
}
FR.WritePane.prototype.cellPasteCheck = function(cell, cev, editorO) {
return cev !== null && !editorO.disabled && editorO.editable !== false && editorO.directEdit !== false;
}
IV. Template download
Click to download the template: