How to embed excel/openoffice cal in qt application
-
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??????
-
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 -
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 -
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.