有没有人在 iOS 中使用 libxlsxwriter 将数据导出到 Excel?我启动并运行了图书馆。下面给出的是我尝试过的代码。
lxw_workbook *workbook = new_workbook("demo.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
int ret = worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
ret = worksheet_write_number(worksheet, 1, 0, 123, NULL);
int ret1 = workbook_close(workbook);
if(LXW_CLOSE_ERROR_ZIP == ret1)
NSLog(@"Failed");
在 workbook_close(); 对我来说一直失败;
这是我收到的错误消息
[ERROR][/path/packager.c:62]: Error opening zip file for xlsx
[ERROR][/path/workbook.c:1108]: Memory allocation failed.
知道为什么会这样吗?还有其他我可以使用的库吗?