-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reading the existed xlsx file seams to be failed. #68
Comments
Dear @maoliangwu Please show us the full test code If you show me the entire code you tested, we or someone can help you. |
|
Trust me these are the entire code this is the main.cpp. #include "xlsxdocument.h"
} This is .pro CONFIG += c++11 console The following define makes your compiler emit warnings if you useany feature of Qt which as been marked deprecated (the exact warningsdepend on your compiler). Please consult the documentation of thedeprecated API in order to know how to port your code away from it.DEFINES += QT_DEPRECATED_WARNINGS You can also make your code fail to compile if you use deprecated APIs.In order to do so, uncomment the following line.You can also select to disable deprecated APIs only up to a certain version of Qt.#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += main.cpp INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt" QXLSX_PARAENTPATH=./ Please help me to find the key,thanks |
1️⃣ Is the file(c1.xlsx) in the same path as the executable program(*.exe)? // check current directory
qDebug() << "[debug] current directory is " << QDir::currentPath(); 2️⃣ Does the value exist in cell (1,1) in the c1.xlsx file? 3️⃣ I have created the dev78 branch for you and have configured the IssueTest example. If you can open a c1.xlsx file or some that you need to test, we can test it by putting it in the example. |
May be you didn't catch my problem. I use the QXlsx code to read,but not write. Is is a mistaken way? |
Can you show me whole test code? (All files including excel files. such as c1.xlsx) |
please get the whole test code by the follows.Thanks |
Thanks for reporting. 1️⃣
2️⃣ QXlsx and current ECMA-376 version uses
|
Ok, I get it now, thanks. I will try QAxObject to read files in this format. |
I've created an excel file manually,there are data in the sheet.
When I use the hello world test code to read the content, it print nothing. xlsxR.load() can't be entered! But when I change the file created and saved by qxls code, it turned to to print the correct result.
Document xlsxR(filepath);
if (xlsxR.load()) // load excel file
{
int row = 1; int col = 1;
Cell* cell = xlsxR.cellAt(row, col); // get cell pointer.
if ( cell != NULL )
{
QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...)
qDebug() << "1.1 "<<var; // display value. it is 'Hello Qt!'.
}
}
Dose it have any difference between the two files. Can I use this to read the files created by other applications? Also the "wsheet->getFullCells( &maxRow, &maxCol );" seams dose not work
The text was updated successfully, but these errors were encountered: