Aswathy Bose
Aswathy Bose

Reputation: 4289

How to open and view .xlsx files in iOS

I can download documents which can be of types .pdf,.xlsx,.jpeg,.tiff etc from an API. If I use UIWebView it doesnot support .xlsx and .msg files.

How can I view these files.

Can anyone help me ?

Upvotes: 0

Views: 1774

Answers (2)

ashokdy
ashokdy

Reputation: 1001

use this code u will get satisfied

-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:file type];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}

try this it will help you to make zimmicks with any type of file

Upvotes: 0

rmaddy
rmaddy

Reputation: 318804

You can use the QLPreviewController to display all of these types of files.

A Quick Look preview controller can display previews for the following items:

  • iWork documents
  • Microsoft Office documents (Office ‘97 and newer)
  • Rich Text Format (RTF) documents
  • PDF files
  • Images
  • Text files whose uniform type identifier (UTI) conforms to the public.text type (see Uniform Type Identifiers Reference)
  • Comma-separated value (csv) files

Upvotes: 2

Related Questions