Import and Export Excel - What is the best library?
I'm going to throw my hand in for flat csv files, if only because you've got the greatest control over the code. Just make sure that you read in the rows and process them one at a time (reading the document to the end and splitting will eat up all of your memory - same with writing, stream it out).
Yes, the user will have to save-as CSV in excel before you can process it, but perhaps this limitation can be overcome by training and providing clear instructions on the page?
Finally, when you export to the customer, if you set the mime type to text/csv, Excel is usually mapped to that type so it appears to the user to be 'an Excel file'.
Best language to use when exporting an excel file
JExcel Api Gives you total control on what you want to write, it's powerful, fast and pure java.
I suggest it, here's a tutorial.
Django/Python Library for importing and producing Excel documents?
You can use python's xlsxwriter
import StringIO
import xlsxwriter
def WriteToExcel(some_data, town=None):
output = StringIO.StringIO()
workbook = xlsxwriter.Workbook(output)
# Here we will adding the code to add data
workbook.close()
xlsx_data = output.getvalue()
# xlsx_data contains the Excel file
return xlsx_data
For further implementation:
Source: How to export Excel files in a Python/Django application
One more useful link I found is THIS.
How to import an excel file in to a MySQL database
Export it into some text format. The easiest will probably be a tab-delimited version, but CSV can work as well.
Use the load data capability. See http://dev.mysql.com/doc/refman/5.1/en/load-data.html
Look half way down the page, as it will gives a good example for tab separated data:
FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\'
Check your data. Sometimes quoting or escaping has problems, and you need to adjust your source, import command-- or it may just be easier to post-process via SQL.
Tool for importing excel spreadsheets
You can use the Jet OLEDB Provider:
connection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mySpreadsheet.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""
Where "HDR=Yes"
means that there is a header row in the cell range
(or named range), so the provider will not include the first row of the
selection into the recordset.
Ref: how to use ADO to read and write data in Excel workbooks
See also:
- C# - ASP.NET - Import and Export Excel - What is the best library?
- Reading Excel files from C#
Related Topics
Oledbparameters and Parameter Names
How to Create a Wpf Usercontrol with Named Content
Windows Phone 8.1 Universal App Terminates on Navigating Back from Second Page
Abstract Classes VS Interfaces
How to Execute Code That Is in a String
How to Set Properties on Struct Instances Using Reflection
Logging Request/Response Messages When Using Httpclient
Strip the Byte Order Mark from String in C#
How to Handle Click Event in Button Column in Datagridview