简体   繁体   中英

Export data to XLS (not via CSV) on iOS

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

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 - 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 - I have hebrew characters, and I already tried all the string encodings, and can't have both hebrew and latin characters.

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?

The LibXL library provides this functionality for both xls and xlsx formats. There is no iOS version, but people say the iOS version is coming. You may want to contact LibXL support to confirm this.

EDIT: The iOS version is available now.

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM