将nsstring放入excel电子表格?

时间:2022-09-11 17:14:35

Any idea how to go about formatting the data so I can export from my app data in excel format or even a simple table would be okay, how are people getting stuff out of the phone?

你知道怎么格式化数据,这样我就可以从我的应用中导出excel格式的数据,甚至一个简单的表格都可以,人们是怎么从手机中获取数据的呢?

This particular app is about keeping track of money, so i can pretty much turn everything into nsstrings but how do I:

这个特殊的应用程序是关于追踪钱的,所以我可以把所有的东西都变成nsstring但是我如何:

A. format the strings so the fields are delimited in some way that can be parsed by a program like excel or word or something like that, and

a .格式化字符串,使字段以某种方式分隔,可以通过excel或word之类的程序进行解析

B. what is the best way to ship that data off to users, even something simple like popping open a mail message with the created file as an attachment.

B.将数据发送给用户的最好方式是什么?甚至是简单的操作,比如将创建的文件作为附件打开邮件消息。

Is this approach possible. Even if its not perfect I want to be able to at least say to users, "hey you can get this data out of the app."

这种方法是可能的。即使它不完美,我也想至少对用户说,“嘿,你可以从应用程序中得到这些数据。”

Thanks for the help,

谢谢你的帮助,

Nick

尼克

2 个解决方案

#1


3  

A. The easiest way is to generate a CSV file -- not even kidding. Excel can open it natively. If you really want a .xlsx file, though, you'll probably have to use a third party library or write your own. Maybe not as hard as it sounds.

答:最简单的方法是生成CSV文件——这不是开玩笑。Excel可以自动打开。但是,如果您真的想要.xlsx文件,您可能需要使用第三方库或编写自己的文件。也许没有听起来那么难。

B. It's not possible to send attachments from the iPhone. The easiest way to export anything is to upload it to a web server and have your user download it separately. Remember that the iPhone is a phone, and isn't really meant for enterprise applications.

从iPhone上发送附件是不可能的。导出任何内容的最简单方法是将其上载到web服务器,并让用户单独下载。请记住,iPhone是一款手机,并不是为企业应用而设计的。

#2


2  

To generate an Excel file, you will have to write out the data in a format that Excel understands. You might want to start by taking a look at

要生成Excel文件,必须以Excel能够理解的格式写出数据。你可以先看看

http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats

http://en.wikipedia.org/wiki/Microsoft_Excel File_formats

which even shows a very simple XML document for a .xls file.

它甚至为.xls文件显示了一个非常简单的XML文档。

#1


3  

A. The easiest way is to generate a CSV file -- not even kidding. Excel can open it natively. If you really want a .xlsx file, though, you'll probably have to use a third party library or write your own. Maybe not as hard as it sounds.

答:最简单的方法是生成CSV文件——这不是开玩笑。Excel可以自动打开。但是,如果您真的想要.xlsx文件,您可能需要使用第三方库或编写自己的文件。也许没有听起来那么难。

B. It's not possible to send attachments from the iPhone. The easiest way to export anything is to upload it to a web server and have your user download it separately. Remember that the iPhone is a phone, and isn't really meant for enterprise applications.

从iPhone上发送附件是不可能的。导出任何内容的最简单方法是将其上载到web服务器,并让用户单独下载。请记住,iPhone是一款手机,并不是为企业应用而设计的。

#2


2  

To generate an Excel file, you will have to write out the data in a format that Excel understands. You might want to start by taking a look at

要生成Excel文件,必须以Excel能够理解的格式写出数据。你可以先看看

http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats

http://en.wikipedia.org/wiki/Microsoft_Excel File_formats

which even shows a very simple XML document for a .xls file.

它甚至为.xls文件显示了一个非常简单的XML文档。