XlsxReaderWriter icon indicating copy to clipboard operation
XlsxReaderWriter copied to clipboard

unable to save string value in worksheet

Open amoljagtap opened this issue 8 years ago • 6 comments

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.

amoljagtap avatar Nov 03 '16 16:11 amoljagtap

@renebigot Appreciate your help.

amoljagtap avatar Nov 04 '16 09:11 amoljagtap

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.

renebigot avatar Dec 15 '16 23:12 renebigot

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.

sunyajie0829 avatar Jan 12 '17 09:01 sunyajie0829

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.

sunyajie0829 avatar Jan 13 '17 02:01 sunyajie0829

[Content_Types].txt

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

jmatze16 avatar Sep 11 '19 05:09 jmatze16

I am having this issue also. What was the exact fix for it?

willm132 avatar Jan 05 '22 16:01 willm132