Best API to read/write EXCEL documents with spring mvc - excel

I am developing a web application with spring-mvc, hibernate and MySQL.
I need to :
export data from Database table to an EXCEL document.
import an excel file , read data, and insert this data in my Database (MySQL).
In the two case, I am using a large sized excel files with .xls or .xlsx format.
Can you help me to find the best API TO READ/WRITE EXCEL files (Apache poi ,JExcel ,....).
And if there are some tutorial dedicated to this need.
I just want to know witch API should i use Apache poi or JExcel and if there is other API and why?.

If you want to process both .xlsx and .xls files than Apache poi is better because Jexcel supports only .xls files. There are other libraries like xlsx4j which supports only .xlsx files. Based on my experience (not opinion, I have worked with all of them) Apache poi has pretty good documentation and a lot of examples/tutorials so it's easier to use. Also support of the both types (.xlsx and .xls) is a huge advantage.

Related

In a wpf project I am importing excel file using Microsoft.Office.Interop.Excel. Do I need Office Primary Interop Assemblies to deploy?

I am new to WPF and trying to read an excel template using C# model class in my application.
You not only need to deploy the interop assembly that you reference along with your application, you would also need to install Excel on the client machines.
Instead of relying on interop, you'd better use some open-source library such as for example EPPlus to handle Excel files in your application.
This should work fine as long as you restrict the use to import files of the open-sourced .xlsx format instead of the proprietary old .xsl format.

Internal structure differance between excel created with Interop and OpenXMLSDK

I would like to know if there is any internal structure differance between the excel created with Microsoft Office Interop Excel(Interop) and Microsoft OpenXMLSDK (openxmlsdk)?
I am currently working with an third party application which rejects the excels created with OpenXMLSDK and accepts only excels created with Interop.
To do the compare you can download the Open XML SDK Productivity tool and use the compare feature. This will allow you to take two excel files and compare their internal XML to see if there are any differences.
Another option if you can't get the tool installed is to rename the file in question to a .zip file and then examine the contents that way. There will be a good amount of files in the zip, but you should be able to compare the files using any compare tool on the web like windiff.

Find Data for Microsoft Project in SharePoint enterprise

Goal:
To view the table's data of the database for Microsoft Project from SharePoint 2010 and/or 2013 enterprise.
Problem:
Where can I find the raw data for Microsoft Project in the database? I would like see the detailed data for the project of the time, milestone etc.
SharePoint doesn't "know" about project management and saves the MS-Project file as one BLOB. Only Microsoft Project Server is capable of parsing MS-Project format and storing the data in a DB.
There are several free alternatives, though:
Parse the MS-Project XML file. That's actually not that difficult.
http://mpxj.sourceforge.net/ is a Java library for reading and writing MS-Project
http://www.project-open.org/ includes a MS-Project import (written by myself) that stores the MS-Project structures in a PostgreSQL database.

Read 1GB size excel with 1.5 Records per sheet to Dataset

I am trying to import large excel files to database using .NET application in which I will do some customized cleansing and processing of data. The excel file will have sheets with 255 columns and 150,000 rows. I tried different solutions such as Microsoft.JET/ACE provider, OpenXML/OfficeOpenXML and LinqToExcel. I get OutofMemory exceptions with both Microsoft adapter and openxml. Please let me know how to deal with it.
Have you tried Integration Services to import an Excel file into SQL Server 2005? You can use Integration Services (a wonderful tool) for extracting, transforming, and loading data. Common uses for Integration Services include: loading data into the database; changing data into to or out from your relational database structures.
You can call this services from you .net code again and again to perform the task in repetitive manor. If not from .net code you can schedule it as well.
see this http://www.techrepublic.com/blog/datacenter/how-to-import-an-excel-file-into-sql-server-2005-using-integration-services/205 sample application for the same.
If you dont want to use SSIS. You could use the following ready to use open tools for the same.
http://exceldatareader.codeplex.com/
http://www.codeproject.com/Articles/14639/Fast-Excel-file-reader-with-basic-functionality
http://www.codeproject.com/Articles/16210/Excel-Reader
This should help you.

Excel & Microsoft.Office.Interop

I want to use the Microsoft.Office.Interop to read an Excel file from a web page.
Do I need to have Office installed on my web server?
I am not doing any manipulation to the excel file, just reading it in and storing the values to another page. I have no issues when I run on my local machine but I have Excel installed on my local machine. Anyone that knows this answer I would greatly appreciate your input.
Thanks
JD
Using Interop requires that you have Office installed on the server. For websites, I would generally recommend using something like the open-source NPOI project. However, if all you ever want to do is read, consider using ADO.NET (see this question for more info).
I would add that if your using Excel as a datasource the ADO approach is much faster and requires less overhead. It restricts you to excel sheets that are pretty much structured as flat tables. But if I can use that method (all restrictions considered) I prefer it.
Ernie

Resources