Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,
i'm new to knockouts. i want to know how to create a knockout application which can read excel sheet and show it in a html table.(need to read Excel sheet data and put it in to an observableArray())

thank you.
Posted
Comments
Maciej Los 3-May-14 4:24am    
What have you done till now? Where are you stuck?
priyankaradesilva 3-May-14 13:27pm    
actually i dont know how to read Excel file usingg java script. here is my plan.
1). i want to get the user selected file path to a observable variable called "selectedPath".
<input type="file" data-bind="selectedPath"></input>

2). <button data-bind="click:read"></button>
i want to have a read method in view model which read the file from given path and push data to an observable array.

eg-
this.read=function(){
//read data from excel which has 2 colums(id,country). while going through each row, need to push to an observable array.
self.countries.push([id:current row's id, country: current row's country]);
}

then i can show it display it using foreach binding.

thank you
priyankaradesilva 3-May-14 6:32am    
actually i dont know how to read Excel file usingg java script. here is my plan.
1). i want to get the user selected file path to a observable variable called "selectedPath".
<input type="file" data-bind="selectedPath"></input>

2). <button data-bind="click:read"></button>
i want to have a read method in view model which read the file from given path and push data to an observable array.

eg-
this.read=function(){
//read data from excel which has 2 colums(id,country). while going through each row, need to push to an observable array.
self.countries.push([id:current row's id, country: current row's country]);
}

then i can show it display it using foreach binding.

thank you
SumithF 15-Sep-14 8:08am    
http://codetheory.in/parse-read-excel-files-xls-xlsx-javascript/
http://forums.asp.net/t/1985755.aspx?How+to+read+excel+sheet+using+javascript+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900