开发者

How to open excel sheet in Android?

Can anyone开发者_Python百科 please help me to know how to open an excel sheet in Android? Thanks


There's not much support around for MS formats in android. All the forums are full of questions about android support for jexcelapi or Apache POI, but no answers to be found. You may give it a shot, but don't have high expectations.

If you have control over the files, just use a csv format or save them as html


In android, jxl.jar is used to create excel sheet and it is available at here and you can create excel sheet by using following code.

File root = Environment.getExternalStorageDirectory();
File gpxfile = new File(root, sFileName);
    FileWriter writer = new FileWriter(gpxfile);
writer.append("NAME");


Use the below mentioned code and try:

File file = new File(Environment.getExternalStorageDirectory()+ "/filepath/" + filename);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.ms-excel");
startActivity(intent);


You could try out jexcelapi or apache poi.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜