Tag: 导出到Excel

使用xml将数据导出到* .xls文件以在iOS 5应用程序上创build文件

我使用下面的代码,在我的iOS应用上创build一个* .xls文件。 一切正常。 我可以用Microsoft Excel打开它,但是,如果我想用Apple Numbers打开它,则不起作用。 – (void)exportToExcel { NSManagedObjectContext *context = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSError *error; NSString *header = @"<?xml version=\"1.0\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\nxmlns:o=\"urn:schemas-microsoft-com:office:office\"\nxmlns:x=\"urn:schemas-microsoft-com:office:excel\"\nxmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\nxmlns:html=\"http://www.w3.org/TR/REC-html40\">\n<Worksheet ss:Name=\"Sheet1\">\n<Table ss:ExpandedColumnCount=\""; NSString *columncount = @"\" ss:ExpandedRowCount=\""; NSString *rowcount = @"\" x:FullColumns=\"1\"x:FullRows=\"1\">\n"; NSString *rowStart = @"<Row>\n"; NSString *rowEnde = @"\n</Row>\n"; NSString *stringStart = @"<Cell><Data ss:Type=\"String\">"; NSString *stringEnde […]