Import and Export Excel - What Is the Best Library

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


  1. Export it into some text format. The easiest will probably be a tab-delimited version, but CSV can work as well.

  2. Use the load data capability. See http://dev.mysql.com/doc/refman/5.1/en/load-data.html

  3. 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 '\'

  4. 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



Leave a reply



Submit