RSSheet
RSSheet copied to clipboard
excel sheet with xml data
Hi,
This is Bharath.
When I use this RSSheet library into my application, it is saving in .xls format bu when I open it, Its showing complete xml string not .xls
I have used the following code
RSworkBook * folder = [ [RSworkBook alloc] init]; folder.author = @"andrea cappellotto"; folder.version = 1.2;
RSworkSheet * sheet = [[RSworkSheet alloc] initWithName:@"prova"];
RSworkSheetRow * row = [[RSworkSheetRow alloc] initWithHeight:20]; [row addCellString:@"prova"]; [row addCellString:@"prova2"]; [sheet addWorkSheetRow:row];
RSworkSheetRow * row2 = [[RSworkSheetRow alloc] initWithHeight:25]; [row2 addCellNumber:100]; [row2 addCellData:[NSDate date] ]; [sheet addWorkSheetRow:row2];
[folder addWorkSheet:sheet];
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; [folder writeWithName:@"prova" toPath:documentsDir];
Could you please tel me what should I do? I am not getting proper excel sheet
Did you resolve this problem?
Same here, if anyone had resolved this please let us know the solution for same
Did anyone find a solution for this?
Same here :(
Some of the XML header data needs to be updated. I replaced line 60 os RSworkBook.m (in the writeWithName function) with the following and it corrected the problem for me:
NSString * head = [[NSString alloc] initWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<?mso-application progid=\"Excel.Sheet\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n xmlns:x2=\"http://schemas.microsoft.com/office/excel/2003/xml\"\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n xmlns:html=\"http://www.w3.org/TR/REC-html40\"\n xmlns:c=\"urn:schemas-microsoft-com:office:component:spreadsheet\">\n<DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\"><Author>%@</Author>\n<LastAuthor>%@</LastAuthor>\n<Created>%@</Created>\n<Version>%.2f</Version>\n</DocumentProperties>\n", self.author, self.author, dateString, self.version];
I will try to create a pull request with the fixed code when i get a chance. Good luck!
by any chance someone got it to work? @timharter the header you provided yields the same results. it just appears as a string.
Hi guys, sorry for the long time, but i changed my work in this years.. Now that i return to develop on iOS i try to update the library
thanks a lot for answering :)