Results 1 to 3 of 3

Thread: how to export my sql table(Qtableview) to a text file or .ods file

  1. #1
    Join Date
    Feb 2014
    Posts
    31
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default how to export my sql table(Qtableview) to a text file or .ods file

    Hello all,
    First of all sorry for my english....
    I was created a sqlite database and a table and it is displaying on the Qtableview of my mainwindow...Now i want to save the table to a text file or a .ods (or Excel file).
    Anybody can please give some instructions to this....

    Thanks in advance...

  2. #2
    Join Date
    Nov 2011
    Posts
    79
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to export my sql table(Qtableview) to a text file or .ods file

    you can save it to .csv, both Excel and OO can read it.

  3. #3
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: how to export my sql table(Qtableview) to a text file or .ods file

    Get the content from database into a QString and after that use QTextStream and QFile to make a .csv file with the content inside QString. Simple as that.
    .csv(comma separated values) can be opened by any spreadsheet(Ms Excel,LibreOffice,OpenOffice etc) application and by any text editor.

Similar Threads

  1. Replies: 16
    Last Post: 28th April 2020, 14:40
  2. Replies: 0
    Last Post: 29th September 2011, 08:32
  3. export file MySql to QtSql
    By pispipepe in forum Qt Programming
    Replies: 4
    Last Post: 21st December 2010, 02:19
  4. how to export data to a .CSV file
    By qtprgrmr in forum Qt Programming
    Replies: 1
    Last Post: 26th May 2010, 16:22
  5. Help:Export QGraphicsView to Image File
    By cometyang in forum Qt Programming
    Replies: 5
    Last Post: 26th December 2007, 23:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.