Skip to content
QtWS25 Last Chance
  • QAxObject Excel and Pivot Chart

    Solved General and Desktop qaxobject excel pivot chart
    3
    0 Votes
    3 Posts
    666 Views
    E
    @JonB Thank you for the link and your answer. I will do those things ! Thanks again & have a nice day !
  • Qt & Excel xlsx outputs

    Solved General and Desktop excel qt5.15.1 xlsx qsqlerror setdatabasename
    25
    0 Votes
    25 Posts
    5k Views
    JonBJ
    @Touchoco Glad it works, but it's a shame to have to change over to 32-bit Qt app just to be able to talk ODBC to Excel. If you want to pursue this further I think it is a non-Qt issue. You would have to Google for something about how to ODBC from a 64-bit executable when I have such-and-such (probably 32-bit) Excel, or similar.
  • 0 Votes
    1 Posts
    575 Views
    No one has replied
  • Export QML TableView as excel file

    Unsolved QML and Qt Quick tableview excel qml
    2
    0 Votes
    2 Posts
    1k Views
    jsulmJ
    @Babs Take a look at https://wiki.qt.io/Handling_Microsoft_Excel_file_format
  • Qt and Excell file

    Solved General and Desktop excel
    6
    0 Votes
    6 Posts
    933 Views
    B
    @mrjj thanks
  • QSqlite query to excel file specific layout

    Unsolved General and Desktop qt5.6 excel qsqlite
    1
    0 Votes
    1 Posts
    621 Views
    No one has replied
  • create Excel file QSqlDatabase open error

    Solved General and Desktop qsql excel
    7
    0 Votes
    7 Posts
    3k Views
    C
    It's Ok, i found the problem. I have to define the full path DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)} to avoid the error message
  • Generating embedded charts via Qt ActiveX

    Solved General and Desktop qaxobject activex excel charts
    24
    0 Votes
    24 Posts
    11k Views
    mrjjM
    Super :) oh it must have "()" on. The syntax is pretty funky via the automation server. Good work.
  • Export sqlserver Data To Text and Excel

    Solved General and Desktop excel text sqlserver
    6
    0 Votes
    6 Posts
    5k Views
    sneubertS
    You can use QSqlQuery to run the select statements and loop the resultset with next() like in VRonin´s example. If you comma seperate the columns like in VRonin´s example you can open this file in excel. One more option, if your on windows is to use ODBC Excel Driver to generate the Excel file. With this you can use QSqlQuery to create tables and insert rows.
  • Question about link with Excel file

    Solved General and Desktop qaxobject excel
    5
    0 Votes
    5 Posts
    3k Views
    M
    Finally Solved.Luckily I found some posts told the reason----It seems the qt has to initialize and release OLE in a sub Thread(the GUI Thread has done this job so sometimes it may not show errors) Here is the code: #include <QCoreApplication> #include <QAxObject> #include "qt_windows.h" //Necessary #include <QVariant> #include <QDebug> int main(int argc, char *argv[]) { //Initialize OLE HRESULT r = OleInitialize(0); if (r != S_OK && r != S_FALSE) {qWarning("OLE initialize failure(error %x)",(unsigned int)r);} QCoreApplication a(argc, argv); QAxObject excel("Excel.Application"); excel.setProperty("Visible",false); QAxObject *workbooks = excel.querySubObject("WorkBooks"); workbooks->dynamicCall("Open (const QString&)",QString("d:/grade.xls")); QAxObject *workbook = excel.querySubObject("ActiveWorkBook"); QAxObject *worksheets = workbook->querySubObject("WorkSheets"); QAxObject *worksheet=worksheets->querySubObject("Item(int)",1); QAxObject *range; QString strVal; QAxObject *usedrange=worksheet->querySubObject("UsedRange"); int endrow=usedrange->querySubObject("Rows")->property("Count").toInt(); int endcolumn=usedrange->querySubObject("Columns")->property("Count").toInt(); for (int i=1;i<=endrow;i++){ for (int j=1;j<=endcolumn;j++){ range=worksheet->querySubObject("Cells(int,int)",i,j); strVal=range->dynamicCall("Value2()").toString(); qDebug()<<strVal; } qDebug()<<endl; } workbook->dynamicCall("Close()"); excel.dynamicCall("Quit()"); OleUninitialize(); return a.exec(); }
  • 0 Votes
    2 Posts
    1k Views
    K
    @greenhouse You would have to use active Qt containers. AFAIK this is not possible on Android. The question is if csv format would not be better for you. You can import this into Excel if required.