views:

128

answers:

3

I am fairly new to Objective C and iOS programming but am constantly trying to learn as much as I can.

I am about to start an iPad project which will involve storing large amounts of data which will need to be exported to one extremely large excel spreadsheet.(it's for a friend....they currently enter massive amounts of data into excel by hand so that they can analyze it).

This database contains over 400 names(this number is constantly growing) and the app will be very functionally similar to to built in contacts app, except that for each name there will be approximately 2,000 attributes. These attributes will be entered across tens, if not over a hundred views.

The excel file will be located on a local server and the database will be synced with it over wifi. If I have to write a server side application to handle this, I happily will.

My question is this: What data storage method would serve best for my purpose accounting for the sheer size of the database and the need to export to excel? (i.e. CoreData?, SQLLite?, XML?)

I sincerely appreciate any help you might offer.

James

A: 

A framework for relational data such as Core Data or SQlite would work well for selecting and working with subsets of data. There's no innate export-to-Excel functionality but you could export a csv (comma-separated-value) file that Excel can import.

Alex Reynolds
Thanks for your quick answer....do you have any pointers as to how I would go about exporting CoreData or SQLite to csv? I also forgot to mention I will be importing from excel(or an exported csv file) as well.Thanks again
JTreanor
Just `SELECT` the data you need out, iterate through the results and write out them to a file (if your data doesn't need escaping, it's simple enough to do manually; if it does, use a library like this: http://michael.stapelberg.de/cCSVParse)
rpetrich
A: 

It'll be harder to create a CoreData store on the server end. I'd suggest using and SQLite DB. FMDB is decent frontend for using SQLite on the iPhone, but there are many others.

coob
Thanks for your response. I am definitely leaning towards SQLite.
JTreanor
Is there anyway of either exporting CoreData to a csv file? Alternatively is there any FMDB documentation...I cant seem to find any.Thanks
JTreanor
As rpetrick says in his comment to the other answer, you'll need to do the CSV export yourself. It shouldn't be too tricky with a bit of iteration. Unfortunately there's no 'standard' way of doing CSV.
coob
A: 

The new http://ODBCrouter.com/ipad (has screenshots of accessing Excel spreadsheets from iPhone) comes with XCode client-side ODBC (Open Database Connectivity) libraries, header files and multi-threaded Objective C objects that would let you directly connect and live-update the Excel spreadsheets via the official Microsoft Excel ODBC driver installed along side of an ODBC Router (there are screen shots of this at that link). The stuff that goes in your app is free, the ODBC Router part runs on Windows (PC or VM) and costs about the same as a TV. The alternatives to date are to try and find some code "out there" that will allow you to produce valid XLS (Excel) files and then upload those onto your server using Cocoa Touch APIs and run some scripts on the server to move them into place, or otherwise to build a fancy website that you interact with using GET and POST and all kinds of JSON/XML parsing.

AugSoft Tom