jeudi 2 avril 2015

Access excel sheet data into our app

We have placed excel in my android mobile SdCard in some location.We need excel data access into My app. We flowed this link http://ift.tt/1yEiS6P so We tried like this but this not work form me



window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);


we tried like this:--



function init(){
alert("selectItems");
//document.addEventListener("deviceready", getDeviceLocation , false);
getDeviceLocation();
}
function getDeviceLocation() {
alert("Ready");
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
function gotFS(fileSystem) {

alert("fileSystem");

fileSystem.root.getFile("test_excel.xlsx", null, gotFileEntry, fail);
}

function gotFileEntry(fileEntry) {
alert("FileEntry");
fileEntry.file(gotFile, fail);
}

function gotFile(file){
alert("gotFile");
readDataUrl(file);
readAsText(file);
}

function readDataUrl(file) {

alert("file");

var reader = new FileReader();
reader.onloadend = function(evt) {
alert("ineral");
console.log("Read as data URL");
console.log(evt.target.result);
};
reader.readAsDataURL(file);
}

function readAsText(file) {
alert("ineral1");
var reader = new FileReader();
reader.onloadend = function(evt) {
alert("ineral2");
console.log("Read as text");
console.log(evt.target.result);
};
reader.readAsText(file);
}

function fail(error) {
alert("error");
console.log(error.code);
}


but gotFS method not called.Please guide me this way right or not.if any other way to do this Please help me


Aucun commentaire:

Enregistrer un commentaire