I know that there are different ways to read an Excel file:
Iterop
Oledb
Open Xml SDK
Compatibility is not a question because the program will be executed in a controlled environment.
My Requirement :
Read a file to a DataTable
/ CUstom Entitie
s (I don't know how to make dynamic properties/fields to an object[column names will be variating in an Excel file])
Use DataTable/Custom Entities
to perform some operations using its data.
Update DataTable
with the results of the operations
Write it back to excel file
.
Which would be simpler.
Also if possible advice me on custom Entities (adding properties/fields to an object dynamically)
For compatibility, XLS has higher compatibility than XLSX. XLS is readable by all Microsoft Excel versions while XLSX is only readable by Excel 2007 and later versions. besides, XLS is able to hold the spreadsheets either including Macros or not, while XLSX isn't capable to support Macros.
Xls viewer can be downloaded on every android device there are no specifications that are necessary, Xlsx File Reader with Xls Viewer can be your default xls reader and directly open the xls file from the file manager, email container or web in this xls viewer without opening the application.
Take a look at Linq-to-Excel. It's pretty neat.
var book = new LinqToExcel.ExcelQueryFactory(@"File.xlsx"); var query = from row in book.Worksheet("Stock Entry") let item = new { Code = row["Code"].Cast<string>(), Supplier = row["Supplier"].Cast<string>(), Ref = row["Ref"].Cast<string>(), } where item.Supplier == "Walmart" select item;
It also allows for strongly-typed row access too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With