tags:

views:

843

answers:

3

I want to devlop an application in iphone where user can open a xls file ,Can do some editing on data already present and finally save it.

How can i do it any idea?

A: 

You can use UIWebView to view an XLS file, but you won't be able to edit it. There's nothing built in to the iPhone SDK that will do this for you. You could try contacting these folks to see if they would license their software to you.

Alex Reynolds
A: 

can u tell me how to use the UIWebView for displaying xls file

hardik
+3  A: 

Yes, Hardik it is very simple if you want to open a local xls file.

  1. Add a local xls file in to your project

  2. Drag and drop an UIWebView control on the view.

  3. Connect Files owner and UIWebView Object

  4. Add this:

- (void)viewDidLoad {
    [super viewDidLoad];

    //Get the path where your local xls file is located
    NSString *FilePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"xls"];

    //Now To use a local resource file in a web view you need to use NSURL fileURLWithPath:
    NSURL *url=[NSURL fileURLWithPath:FilePath];

    //URL Requst Object
    NSURLRequest *requestObj=[NSURLRequest requestWithURL:url];

    //Load the request in the UIWebView.
    [m_webView loadRequest:requestObj];
}

Now just Build and Go

raaz