dbzhang800 / QtXlsxWriter

.xlsx file reader and writer for Qt5
http://qtxlsx.debao.me
Other
1.22k stars 630 forks source link

Is QtXlsx currently maintained? #188

Open mhkelley opened 5 years ago

mhkelley commented 5 years ago

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 commented 5 years ago

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

mhkelley commented 5 years ago

Thanks

From: Luca notifications@github.com Sent: Tuesday, March 26, 2019 6:57 AM To: dbzhang800/QtXlsxWriter QtXlsxWriter@noreply.github.com Cc: mhkelley mhkelley2017@gmail.com; Author author@noreply.github.com Subject: Re: [dbzhang800/QtXlsxWriter] Is QtXlsx currently maintained? (#188)

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dbzhang800/QtXlsxWriter/issues/188#issuecomment-476615423 , or mute the thread https://github.com/notifications/unsubscribe-auth/AezlM59r1sIrljAd3MCDTvjZhL49-_V2ks5vahkwgaJpZM4cJTKY . https://github.com/notifications/beacon/AezlM4WfRdePbsou2UZqCHFUxH0yKDtiks5vahkwgaJpZM4cJTKY.gif

stachna commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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> ...