XlsxReaderWriter
XlsxReaderWriter copied to clipboard
unable to save string value in worksheet
I trying to save string value in worksheet, using [spreadsheet save] method but app crashes and throws an exception,
Here is the exception log, It says contentType is not implemented.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[BRARelationship contentType] is not implemented in BRARelationship' *** First throw call stack: ( 0 CoreFoundation 0x00007fffc520352b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fffd98dbcad objc_exception_throw + 48 2 CoreFoundation 0x00007fffc5208232 +[NSException raise:format:arguments:] + 98 3 Foundation 0x00007fffc6c3b390 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195 4 XlsxReaderWriter 0x00000001000ff65d -[BRARelationship contentType] + 301 5 XlsxReaderWriter 0x00000001000bd28a -[BRAOfficeDocumentPackage save] + 2026
Here is my code snippet,
BRAOfficeDocumentPackage *spreadsheet = [BRAOfficeDocumentPackage open:documentPath]; BRAWorksheet *worksheet = spreadsheet.workbook.worksheets[0];
NSString *indexColumn = @"J22"; BRACell *decriptionCell = [worksheet cellForCellReference:indexColumn shouldCreate:YES]; [decriptionCell setStringValue:description];
after this I am invoking
[spreadsheet save] - crashes the app, throws exception "contentType" not implemented.
Appreciate your help.
@renebigot Appreciate your help.
I think that there's an unknown type of file included in your XLSX file.
Rename your XLSX file (the one before saving) to ZIP, extract the ZIP content and open [Content_Types].xml
. Post this file content here.
Hi,i am from chinese.I have the same problem. it can be save sucessfully with stringValue,also with integerValue.but the table with stringValue can't be open normally,it says "some content can't be read". while the table with integerValue can be open normally. thanks for your code,and hope you can help me to solve problem,thank you again.
Sorry for not noticing the issue which was mentioned in the closed issues before. The solution is to create an empty xlsx file, enter any content in A1, and then set all the table format as the text, and then this xlsx file can be operated as a template file, the osx test can be passed.
I think that there's an unknown type of file included in your XLSX file.
Rename your XLSX file (the one before saving) to ZIP, extract the ZIP content and open
[Content_Types].xml
. Post this file content here.
Hi Renebigot,
I am experiencing the same issue. Ive been trying to debug and it appears that it doesn't like: /customXml/item3.xml With type: http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml
I am having this issue also. What was the exact fix for it?