Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting an excel file
Forum Update on Monday, May 27th 2025

Getting an excel file

Scheduled Pinned Locked Moved General and Desktop
8 Posts 5 Posters 6.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kitten
    wrote on last edited by
    #1

    hi to every one
    how can i generate an excel file in my application?
    thanks alot

    www.kitten.mihanblog.com

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Not with standard Qt objects.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        loladiro
        wrote on last edited by
        #3

        There is no way to do that in Qt itself.
        However, you have a few options:

        • Generate a .csv file
        • Use a third party library to generate a .xls or .xlsx
        • Generate the xlsx by creating the necessary files your self and zipping them

        For other solutions (like embedding MS Office through COM Objects) and links to specific libraries, look here:

        "Discussions of Excel on the DevNet":http://developer.qt.nokia.com/search/tag/excel

        "Discussions of Word on the DevNet":http://developer.qt.nokia.com/search/tag/word

        "Discussions of CSV on the DevNet":http://developer.qt.nokia.com/search/tag/csv

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kitten
          wrote on last edited by
          #4

          how can i generate a .csv file?

          www.kitten.mihanblog.com

          1 Reply Last reply
          0
          • L Offline
            L Offline
            loladiro
            wrote on last edited by
            #5

            There are a few tricks dealing with csv files.
            First, you should have a read "here":http://en.wikipedia.org/wiki/Comma-separated_values
            Then, you should ask yourself what kind of data you're trying to save and if it can contain symbols used in csv files.
            If they don't you can just put all the data in a row seperated by a comma (or a semicolon).
            If they do you'll have to wrap the fields in double quotes (") and replace all occurrences of double quotes in your data with double double quotes ("").

            1 Reply Last reply
            0
            • jensen82J Offline
              jensen82J Offline
              jensen82
              wrote on last edited by
              #6

              Generate a CSV-File and convert it to Excel is the easiest way i think. Another way is: study the XLS-Format. Under "Wotsit":http://www.wotsit.org/list.asp?al=X you can find an explanation.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                soroush
                wrote on last edited by
                #7

                I have done it before. don't know that is a good way or not.

                Just download "BasicExcell Library":http://www.codeproject.com/KB/office/BasicExcel.aspx create a new Qt library project, add source code of BasicExcel, and compile the library. Then include that library (on linux .so file) to your Qt project and you can read/write Excell files.

                Note: I didn't use CSV, but write data directly from a MySQL database to xls file.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kitten
                  wrote on last edited by
                  #8

                  thanks alot

                  www.kitten.mihanblog.com

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved