前のバージョン12 :Excel のセルデータを書き込みセルにコピーする Back to Doc
編集時間: Doc Length:Image Number:Directory Number: 変更理由:

Catalog:

I. Overview编辑

1. Application scenarios

Finereport supports copying data from Excel to the filling 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.

截屏2021-01-11 上午9.30.57.png


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) {
//Remove trailing line breaks
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;