title: Export SQLite data to Excel in iOS programmatically
body: <p>In my application,i am using sqlite as a backend(to store data locially).
  I am able to insert data into my table.but what i want to do is,want to import all my sqlite data into excel programmatically.And i don't want to use server for this app.once the excel sheet is generate user should be able to mail that sheet.
  Is this possible in iPhone:
  Please help me out .</p>
  
  <p>Following is my code to insert data into table:</p>
  
  <pre><code>-(IBAction)Login
  {
  sqlite3_stmt *stmt;
          char *errorMsg; 
          char *update1 = "insert into Login1 values (?,?,?,?);";
          int x = sqlite3_prepare_v2(database, update1, -1, &amp;stmt, nil);
  
      if (x == SQLITE_OK) 
      { 
          sqlite3_bind_text(stmt, 1, NULL,-1, NULL);
          sqlite3_bind_text(stmt, 2, [USERID UTF8String],-1, NULL);
          sqlite3_bind_text(stmt, 3, [str1 UTF8String],-1, NULL);
          sqlite3_bind_text(stmt, 4, [str4 UTF8String],-1, NULL);
  
  
      } 
  
      if (sqlite3_step(stmt) != SQLITE_DONE)
          NSLog(@"Error: %@",errorMsg); 
      sqlite3_finalize(stmt);
  </code></pre>
  
  <p>}</p>