How report tools implement multiple import of Excel

Source: Internet
Author: User

Many people in the development of the report will encounter the same multiple forms of Excel imported into the template, and then submitted to the database. However, the problem is that online import does not support selecting multiple excel at once, you can select only one excel at a time, and you cannot import data from more than one Excel into a template without committing to it, that is, if you have data in the Web page before you import Excel, When you import Excel, the previous data is overwritten.

So is this a problem that can't be solved?

The solution is to use Finereport to customize an Excel import button, click on the button when the last import to the template data to submit, while refreshing the page, to restore the page to the original blank state, and implement the Excel import operation, and then click the Import button, Importing the next Excel, and so on, can be a lot easier to do.

For example, the following 2 samples of the same Excel imported into the Finereport template:


1. Modify the form so that it matches the title name in Excel, such as:



2. Report Reporting Property Modification

Modify the column in the report properties and the corresponding column in the database, here only need to modify the category ID corresponding to the value, modified to map (C2, "Ds2", 2, 1).

3. Custom Import button

Click Templates > Templates Web properties > Fill in Page Settings, double-click the Custom button in the toolbar, add the button to the top toolbar, and delete the built-in Import Excel button and submit button, such as:



4. Custom Event Authoring

In the solution to describe the custom button needs to do is: when the button is clicked, the last import into the template of the data to submit, while refreshing the page, so that the page back to the original blank state, and implement the Excel import operation.

In the toolbar editing screen, select the Custom button and click on custom events, such as:



Write down the JS statement in the JavaScript script, such as:


var value=contentpane.getcellvalue (0,1,2);   if (value!= "") {        FR. Msg.confirm (function(result) {              if(result) {              _g (' ${sessionid} '). Writereport ();              Contentpane.refreshallsheets ();              Contentpane.importexcel ();}}          );  }    Else {      contentpane.importexcel ();      }  

Click Fill Preview, click the import Excel this custom button, select the first Excel to import, and then click the second need to import Excel, the page will prompt to submit the last import data, click OK, the last import data will be submitted to the database, and then pop up the file selection box, You can then select the second Excel, and so on.

To be reminded that the use of this tool to fill out the report online multiple imports of Excel only support the import of blank templates, that is, the filling template can not have the original data exist; Online multiple import Excel support a variety of styles of reporting, not only limited to the line report, but if it is non-line reporting, The control location of the report needs to be consistent with the data location in Excel, and the row report needs to keep the title name consistent.

How report tools implement multiple import of Excel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.