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. How to embed excel/openoffice cal in qt application
Forum Updated to NodeBB v4.3 + New Features

How to embed excel/openoffice cal in qt application

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 5.7k Views 1 Watching
  • 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.
  • H Offline
    H Offline
    honey25
    wrote on 17 Sept 2012, 07:41 last edited by
    #1

    hi,

    i need a help to embed excel/openofficecal in my qt application.i have used setControl(Excel.Application).excel is opening as a separate application.i want to show excel in Qmainwindow.Is it possible in qt??????

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jiapei100
      wrote on 22 Nov 2013, 12:12 last edited by
      #2

      Exactly the same question from me.....

      Welcome to Longer Vision
      https://www.longervision.com

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vezprog
        wrote on 22 Nov 2013, 14:01 last edited by
        #3

        I tried to do this a couple years ago and there wasn't much support. There are a couple c++ libraries out there that have wrappers to read and write to an excel workbook but that's all that I know of.

        I ended up using a QTableView / QTableWidget and styled it enough to look like an excel document and using an active X control to write to the .xls files to output the proper data to the spreadsheet on a save action. Unfortunately its quite a bit of code for such a somewhat simple task (from my experience, the active x control io is hard to error check).

        Just looking around now though, this seems like a fairly new project that will allow you to do the xls file IO.
        https://github.com/dbzhang800/QtXlsxWriter

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jiapei100
          wrote on 23 Nov 2013, 08:28 last edited by
          #4

          Wow... Hi...
          Thank you so much for your kindly contribution. But, do you still have something similar to open a PPT, a Word documentation, etc???

          Cheers
          Pei

          Welcome to Longer Vision
          https://www.longervision.com

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jiapei100
            wrote on 23 Nov 2013, 12:10 last edited by
            #5

            Hi, Zhang:

            It seems your open source reports a bug when I tried to build the library, I got

            bq. 1>GeneratedFiles\Debug\moc_xlsxdocument.cpp(62): error C2491: “QXlsx::Document::staticMetaObject” definition of dllimport static data member not allowed

            What happened to this variable?
            @const QMetaObject QXlsx::Document::staticMetaObject = {
            { &QObject::staticMetaObject, qt_meta_stringdata_QXlsx__Document.data,
            qt_meta_data_QXlsx__Document, qt_static_metacall, 0, 0}
            };@

            Please let me know at your convenience.

            Cheers
            Pei

            Welcome to Longer Vision
            https://www.longervision.com

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dbzhang800
              wrote on 25 Nov 2013, 03:24 last edited by
              #6

              Hi,

              In which way the library you used? If you are integrate the source code into your application directly, the following macro is needed.

              @
              XLSX_NO_LIB
              @

              This macro will be defined automatically if your are using qmake. Otherwise you need to defined it yourself.

              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