2013年9月26日星期四

According to the data corresponding to the excel template export

Client submits an excel template , then check out the data from the database to import the template ?
I ask how to achieve ?
I now have two ideas refer to:
one ,
1, directly read the user-supplied templates ;
2, then after the data is written to excel in the corresponding position .
This scenario seems to work. ( Get files )
two ,
1, will provide users with templates uploaded to the server ;
2, operate with poi excel, to write data ;
3, generate a new excel to the user.
great God who is also requested to provide good program !
------ Solution ---------------------------------------- ----
templates that allow users to upload data to the provisions that must excel header name, which is what the name of the database in which the corresponding field , the user must be specified or else just write ghost that is representative of the header What are the normal template selected users on the system which fields you want to export the data server to the user generated
------ Solution -------------- ------------------------------
second approach it, the practice is so common .
You have to ensure that users upload template is fixed, otherwise you have to change the program .
case of a fixed template , you do not let users upload, directly into the server directory, that directory each time the program taken from the template , and then generate new data to the user
------ Solution --------------------------------------------

  
Now that is a template that is fixed in nature .   
 
template header fixed, then you do not want users to upload , and directly exported when the user a choice to the user which fields you want to export ( field course, is present in the table and should be based on Chinese users can understand meant to show to the user ) , it wants to make them tick , tick the field that you want to check the data into the database , the Chinese meaning of these fields is the head of the table excel . With poi generated excel wants
------ Solution ---------------------------------- ----------

I also thought directly on the server, the template header is not altered , but some of the field's value will change.  

If the template field value changes will affect the overall result , then it would provide an upload interface , if the user would like to modify the template , you will back up an existing template , use the new template to generate data
------ Solution ------------------------------------------ -

I also thought directly on the server, the template header is not altered , but some of the field's value will change.   users to upload the template header generally are likely to be Chinese , and the database field is in English , but do not know what attributes corresponding to that field , at least you have to write a configuration file to parse Chinese field generated file before first read the configuration file , such as: name = name, Age = age, so
------ For reference only -------------------- -------------------


Now that is a template that is fixed in nature .

------ For reference only ---------------------------------- -----

I also thought directly on the server, the template header is not altered , but some of the field's value will change.

没有评论:

发表评论