在iOS上将数据导出到XLS(不通过CSV) [英] Export data to XLS (not via CSV) on iOS

查看:139
本文介绍了在iOS上将数据导出到XLS(不通过CSV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一些数据导出到.XLS文件,pdf并进行打印.

I need to export some data to an .XLS file, pdf, and print.

我已经尝试了简单的解决方案:使用 CHCSVWriter 将其导出到.CSV.它适用于打印并将其保存为pdf(我在UIWebView和

I already tried the simple solution: exporting it to .CSV with CHCSVWriter. It works for printing and saving it to pdf (I open the CSV in a UIWebView and get the PDF or print from there). However, to use the CSV to be open in excel has two main problems:

1-首先,顾名思义,在CSV中,值用逗号分隔,并且在某些版本中是Excel,它要求用户.

1 - First, as the name says, in the CSV the values are separated by commas, and in some versions of Excel, it requires the user to separate 'manually' in cells.

2-我有希伯来语字符,并且我已经尝试了所有字符串编码,并且不能同时拥有希伯来语和拉丁语字符.

2 - I have hebrew characters, and I already tried all the string encodings, and can't have both hebrew and latin characters.

因此,在尝试使用CSV解决上述问题几天后,我放弃了,于是我放弃了.如何将数据导出到XLS?

So, after giving up after days of trying to use CSV to solve the issues above, I gave up. How can I export my data to XLS?

推荐答案

This article explains how to programmatically create an Excel (.xls) file without using any external library. It just opens a file stream and it writes XML contents straight to it.

它是用C#编写的,但是它的核心信息是XML格式,用于创建节点并填充相应单元格值和格式的属性.

It is written in C#, but the core information coming out of it is the XML formatting used to create nodes and fill attributes for corresponding cell values and formatting.

请考虑我自己还没有尝试过,我在搜索时发现了它.请随时询问一些C#位是否不清楚. HTH

Please consider I have not tried this myself, I found it while doing a search. Please feel free to ask if some C# bits are not clear. HTH

这篇关于在iOS上将数据导出到XLS(不通过CSV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆