Skip to content
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

Is QtXlsx currently maintained? #188

Open
mhkelley opened this issue Mar 25, 2019 · 6 comments
Open

Is QtXlsx currently maintained? #188

mhkelley opened this issue Mar 25, 2019 · 6 comments

Comments

@mhkelley
Copy link

Have just started using QtXlsx. Largely successful, but have two issues I'd like to explore. Does anyone maintain this library or is anyone willing to assist a bit in trying to modify a couple of things?

Specifically: 1) DateTimes to not appear to be handled properly and 2) does not seem to handle really big integer values.

Thanks

@VSRonin
Copy link

VSRonin commented Mar 26, 2019

It is maintained in a fork: https://github.com/VSRonin/QtXlsxWriter
Or a "branch out" of the library: https://github.com/QtExcel/QXlsx

@mhkelley
Copy link
Author

mhkelley commented Mar 26, 2019 via email

@stachna
Copy link

stachna commented Mar 28, 2019

ad 1) example
if (value->toDate() == QDate(1900,1,1)) m_sheetOrg->writeBlank(rowOffset, col, dateFormat); else m_sheetOrg->writeDateTime(rowOffset, col, value->toDateTime(), dateFormat);
ad 2) from source xlsxworksheet.cpp
`bool write(int row, int column, const QVariant &value, const Format &format=Format());
...

f (value.userType() == QMetaType::Int || value.userType() == QMetaType::UInt
|| value.userType() == QMetaType::LongLong || value.userType() == QMetaType::ULongLong
|| value.userType() == QMetaType::Double || value.userType() == QMetaType::Float) {
//Number

    ret = writeNumeric(row, column, value.toDouble(), format); 

`

@mhkelley
Copy link
Author

stachna:

????? Sorry, don't understand what you mean here. I think your examples show that if you have a QDateTime value, you can write it to a worksheet. And the code snippet show that if you have a LongLong value, the existing code should write it.

Unfortunately, neither addresses the question of how you would have read either the QDateTime or the LongLong in the first place.

Am I missing something?

@mhkelley
Copy link
Author

Stachna::

Also, It didn't look like the saveXmlCellData mudule respects either the QDateTime or the LongLong anyway. Looks like if the cellType is Cell::NumberType, it always encodes the xml as a double.

????

@stachna
Copy link

stachna commented Apr 2, 2019

Sorry,
I did not read it carefully.
From XLSX always read as QVariant and format this in source
change you file extension from xlsx to zip look in woorsheets/..
and sharedStrings.xml if stored date as string - sometime whithout formting cell
Q: ... really big integer values: how big

Answer is format cell:

double stored as int:

numFormat0.setNumberFormat("# ##0");
m_sheet->writeNumeric(rowOffset, col, value->toDouble(), numFormat0); 

B22 = 2019-04-02 12:14:00
B24 = 123456789012345
in xml:

... <c r="B22" s="57"><v>43557.509722222225</v></c>...
... <c r="B24"><v>123456789012345</v></c> ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants