Home > other >  MVC import and export
MVC import and export

Time:11-25

Did the plane reservation system after the project, a preliminary understanding the MVC,
The following simple introduce the MVC:
MVC is one of the three kinds of ASP.NET programming model,
MVC is a kind of use the MVC (Model View Controller Model View Controller) is designed to create a Web application pattern:
Model (Model) for application core (such as a database record list),
The View (View) display data (database records),
Controller (Controller) processing input (written to the database records),
The MVC pattern at the same time provides for HTML, CSS and JavaScript complete control,
The MVC pattern definition Web application
With three logic layer:
The business layer (logical) model; Display layers (view logic); Input control logic (the controller)
Model (Model) : is used for processing the application data in the application logic part, usually the Model object is responsible for the data in the database access,
The View (View) : is a part of the application process data display, data View is usually based on the model created,
Controller (Controller) : is a part of the application handle user interaction, usually Controller is responsible for the data read from the view, the control of user input, and send the data to the model,

Recognize the Excel data derived from the MVC:
1-2 - NPOI msoffice Excel (JAVA POI)
Use the browser's download file
The following is the method of query Excel export order data:

After the way to use the template export Excel:
Read after the template for the template file path
Using NPOI open the Excel template
Use the file to open the template file
To populate the data set data cell in the template style
Horizontal vertical center alignment
Began to populate the data: (this template data begin to populate the data row index value is fill out the reference to Excel)
Traverse the query the data fill in return to Excel in the form of flow into a stream, the output... And so on,
The import data of some precautions:

FirstCellNum: get a line the first cell subscript
LastCellNum: get a certain number of columns!!!!!!!!!!!
FirstRowNum: to get the actual line the first subscript
LastRowNum: to get the actual line last subscript
  • Related