How to embed excel/openoffice cal in qt application
-
wrote on 17 Sept 2012, 07:41 last edited by
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??????
-
wrote on 22 Nov 2013, 12:12 last edited by
Exactly the same question from me.....
-
wrote on 22 Nov 2013, 14:01 last edited by
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 -
wrote on 23 Nov 2013, 08:28 last edited by
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 -
wrote on 23 Nov 2013, 12:10 last edited by
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 -
wrote on 25 Nov 2013, 03:24 last edited by
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.