Coder Social home page Coder Social logo

qtexcel / qxlsx Goto Github PK

View Code? Open in Web Editor NEW
988.0 43.0 321.0 8.63 MB

Excel file(*.xlsx) reader/writer library using Qt 5 or 6. Descendant of QtXlsxWriter.

Home Page: https://qtexcel.github.io/QXlsx/

License: MIT License

QMake 1.61% C++ 76.51% QML 0.11% Python 0.06% Batchfile 0.01% C 20.37% CMake 1.34%
excel xlsx qt cpp qxlsx qt5 c qt6 cpp11 cxx

qxlsx's Introduction

QXlsx

Read this in other languages: English, ๐Ÿ‡ฐ๐Ÿ‡ท Korean, ๐Ÿ‡ท๐Ÿ‡บ Russian

  • QXlsx is excel file(*.xlsx) reader/writer library.
    • Because QtXlsxWriter is no longer supported, I created a new project that is based on QtXlsx. (2017-)
  • Development language of QXlsx is C++. (with Qt)
  • You don't need to use static library or dynamic shared object using QXlsx.
    • You can also use it as a static library.

How to use

How to set up (Installation)

Github Actions

Android IOS MacOS Ubuntu Windows CMake cmake-ubuntu

Contributions

License and links

๐Ÿ“ง Contact

  • Leave me a issue. https://github.com/QtExcel/QXlsx/issues
    • If you are interested in participating in the project, please contact us by issue.
    • My native language is not English and my English is not fluent. Please, use EASY English. :-)
  • If you would like to translate README.md into your native language, please contact me.
    • You can either raise an issue or use a pull request. (such as README.ko.md)

Similar projects

  • Qxlnt is a helper project that allows xlnt to be used in Qt.
  • xlnt is a excellent C++ library for using xlsx Excel files.
  • I was looking for a way to make it easy to use in Qt. Of course, cmake is compatible with Qt, but it is not convenient to use. So I created Qxlnt.

  • Qlibxlsxwriter is a helper project that allows libxlsxwriter to be used in Qt.
  • libxlsxwriter is a C library for creating Excel XLSX files.
  • Use SimpleXlsxWriter in Qt.
  • SimpleXlsxWriter is C++ library for creating XLSX files for MS Excel 2007 and above.

qxlsx's People

Contributors

antonio-rojas avatar dantti avatar darthgandalf avatar deining avatar dfaure-kdab avatar gerlachs avatar gnudles avatar gunnerfreeman avatar huvic avatar iliis avatar imgbotapp avatar j2doll avatar jihadist avatar jopemachine avatar laurennlam avatar liufeijin avatar martindelille avatar netnazgul avatar projectmutilation avatar skyzhou95 avatar waqar144 avatar zgblkylin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qxlsx's Issues

Lock properties

Thanks for the great project.
I used it to generate simply excel file, but I have necessity to lock some columns.
Seem's any lock implementation yet.
Is it correct? Or How can lock columns?
There is the possibility to have any sort of lock?
Many thanks
Fabrizio

QXlsx as a DLL

We like to use QXlsx as a DLL in our project and found that QXlsx is arranged for a static LIB. By studying the code it occured to us that the macro Q_XLSX_EXPORT is missing in the header files compared to QtXlsx.

Is it possible to change the project, so that it is possible to create DLLs with little effort? Thanks in advance!

after write xlsx, /xl/calcChain.xml will be lose

after write xlsx, /xl/calcChain.xml whole will be lose.
the row as below will be lose also in /[Content_Types].xml
" Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml" PartName="/xl/calcChain.xml"/ โ€œ

open a exist excel file and print out it

Sorry for my bad English.
My mean is how to open a exist excel file and print out it on paper.
Some times a excel file has many sheets , maybe we only want to print out i sheet only.
Does QXlsx provide this print function? ( or Qxlnt ? Qlibxlsxwriter? )
best regards,
jeff

Qt 5.14.0 QString don't have member function 'sprintf'

The error happened in Qt 5.14.0

QXlsx\QXlsx\source\xlsxcolor.cpp:145:11: error: 'class QString' has no member named 'sprintf'; did you mean 'asprintf'?
color.sprintf("%02X%02X%02X%02X", c.alpha(), c.red(), c.green(), c.blue());
^~~~~~~
asprintf

xlsx.read(int row,int col) problem

i want to get a cell value by using xlsx.read(3,13+j3).
But it return the formula in the cell not the value. like "=($P$1+$S$1)+$P$1/15
(15-CA2)")

How can i get cell value but not formula?

Best regards,
jeff

comments will be lost after write by QXlsx

If the original excel file contain a comment
TIMๆˆชๅ›พ20190708152518
after write by QXlsx the comment wil be lost.
I compare orignal excel file zip and after write file zip
The comments1.xml is lose.
TIMๆˆชๅ›พ20190708152501
Could you have a look how to resolve it?
Desktop.zip

Concurrent dump

I read multi excel at the same time ,but my app corrupt occasionally, i have check the dmp file, but i havent find any clue. The log shows as follows,

[11-08 08:42:15.461] 16344(HtParseInportExcelFile) File:() Line:(0) Debug stream operator already registered for type QXlsx::XlsxColor

[11-08 08:42:15.461] 14620(HtParseInportExcelFile) File:() Line:(0) Debug stream operator already registered for type QXlsx::XlsxColor

[11-08 08:42:15.461] 18088(HtParseInportExcelFile) File:() Line:(0) Debug stream operator already registered for type QXlsx::XlsxColor

i think the dumption is caused by concurrention, which means this tools may not fit for concurrent scence.

very bad news, any shape in excel file will be lose after writing by QXls

if the excel has drawing (shape) , after writing they will be lose .
as below items will be in /xl/drawings/drwawing1.xml

-<xdr:twoCellAnchor editAs="absolute">

-xdr:from

xdr:col1</xdr:col>

xdr:colOff23813</xdr:colOff>

xdr:row7</xdr:row>

xdr:rowOff0</xdr:rowOff>

</xdr:from>

-xdr:to

xdr:col16</xdr:col>

xdr:colOff219075</xdr:colOff>

xdr:row21</xdr:row>

xdr:rowOff71438</xdr:rowOff>

</xdr:to>

-<xdr:sp textlink="" macro="">

-xdr:nvSpPr

<xdr:cNvPr name="็Ÿฉๅฝข 6" id="7"/>

xdr:cNvSpPr/

</xdr:nvSpPr>

-xdr:spPr

-<a:xfrm>

<a:off y="1543050" x="452438"/>

<a:ext cy="2871788" cx="6110287"/>

</a:xfrm>

-<a:prstGeom prst="rect">

<a:avLst/>

</a:prstGeom>

-<a:blipFill rotWithShape="1" dpi="0">

-<a:blip r:embed="rId1" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">

-<a:extLst>

-<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">

<a14:useLocalDpi val="0" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"/>

</a:ext>

</a:extLst>

</a:blip>

<a:srcRect/>

-<a:stretch>

<a:fillRect/>

</a:stretch>

</a:blipFill>

<a:ln w="3175"/>

</xdr:spPr>

-xdr:style

-<a:lnRef idx="2">

-<a:schemeClr val="accent1">

<a:shade val="50000"/>

</a:schemeClr>

</a:lnRef>

-<a:fillRef idx="1">

<a:schemeClr val="accent1"/>

</a:fillRef>

-<a:effectRef idx="0">

<a:schemeClr val="accent1"/>

</a:effectRef>

-<a:fontRef idx="minor">

<a:schemeClr val="lt1"/>

</a:fontRef>

</xdr:style>

-xdr:txBody

<a:bodyPr anchor="t" rtlCol="0" horzOverflow="clip" vertOverflow="clip"/>

<a:lstStyle/>

-<a:p>

<a:pPr algn="l"/>

<a:endParaRPr lang="zh-CN" sz="1100" altLang="en-US"/>

</a:p>

</xdr:txBody>

</xdr:sp>

Seems QXls miss to writ the shape item.
Could you improve it? I have no any information about it.
best regards,
jeff

can it surport xls files?

i have some .xls files must be generated from an old designed program, and the files need import to another program designed by Qt5, so....it troubled me

Failed to compile - โ€œprivate/qzipwriter_p.hโ€: No such file or directory

When I compile QXlsx\source\xlsxzipwriter.cpp in vs2013 and qt 5.9.1, error is throwed : โ€œprivate/qzipwriter_p.hโ€: No such file or directory . I have found this in Qt5.9.1\5.9.1\msvc2013_64\include\QtGui\5.9.1\QtGui\private, and finally I compile successfully after adding these include path: Qt\Qt5.9.1\5.9.1\msvc2013_64\include\QtCore\5.9.1, C:\Qt\Qt5.9.1\5.9.1\msvc2013_64\include\QtGui\5.9.1, C:\Qt\Qt5.9.1\5.9.1\msvc2013_64\include\QtGui\5.9.1\QtGui\

There in no any footer and header writing method!!!

Dear J2doll

Tonight i found QXlsx has no any method for writing header and footer!
I have checked Qlibxlsxwriter has it .
QXlsx has reading and writing function but method is less than Qlibxlsxwriter.
Qlibxlsxwriter is lose read method only , so i think you can mix 2 project together .
suggest you make a reading function for Qlibxlsxwriter.
If you know the Qlibxlsxwriter data struct ,i think the reading function will be a easy job.
:)

[K] Question aboutQXlsx : Docs, or how to autofit column

Hello Jay Two,

My name is K. [remove personal Info]
I am redoing a Visual C++ big project in Qt, and I had to find a way to process data in Excel (read ans write).

I have found a link of QXsls on the QT Web pages, I have downloaded your examples, and I find that this is an excellent way to answer my need.

I would like to understand the code a little bit more in depth, is there any documentation for me to dig into it?

Currently, I am wondering if there is a way to emulate an autofit for a column (double click on the column separator, and the column size will auto fit to the largest item in the column). I have looked into the Format and only found a ShrinkToFit. Is it available somewhere, or shall i need to code it myself? In the latter case, what would be the easiest way to have the size of the content of a Cell?

I thank you by advance if you find the time to answer me.

I also thank you for the very good work that you did, and that will allow me to fix my need anyway.

from K. [remove personal Info]

Sources do not compile: CellLocation constructor error

https://github.com/j2doll/QXlsx/blob/dc31d0ff00425481d037863c191cf96e2c8d34ec/QXlsx/source/xlsxcelllocation.cpp#L20

3rdparty\QXlsx\QXlsx\source\xlsxcelllocation.cpp:20: error: C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
C:\Qt\5.5\msvc2013\include\QtCore/qsharedpointer_impl.h(330): could be 'QSharedPointerQXlsx::Cell &QSharedPointerQXlsx::Cell::operator =(QSharedPointerQXlsx::Cell &&)'
C:\Qt\5.5\msvc2013\include\QtCore/qsharedpointer_impl.h(317): or 'QSharedPointerQXlsx::Cell &QSharedPointerQXlsx::Cell::operator =(const QSharedPointerQXlsx::Cell &)'
while trying to match the argument list '(QSharedPointerQXlsx::Cell, int)'

MSVC2013 x86 is used to compile the project.

Normal Formula are not working

Excel xlsx files stores "normal" Formulars in other ways than implemented.

Please see the following change, it is correct in the former version:

bool CellFormula::loadFromXml(QXmlStreamReader &reader)
{
Q_ASSERT(reader.name() == QLatin1String("f"));
if (!d)
d = new CellFormulaPrivate(QString(), CellRange(), NormalType);

QXmlStreamAttributes attributes = reader.attributes();
QString typeString = attributes.value(QLatin1String("t")).toString();

// branch: shared-formula
//
if (typeString == QLatin1String("array")) {
    d->type = ArrayType;
}
else if (typeString == QLatin1String("shared")) {
    d->type = SharedType;
}
else if (typeString == QLatin1String("normal")) { // will never ocure in xlsx files.
    d->type = NormalType;
}
else if (typeString == QLatin1String("dataTable")) {
    d->type = DataTableType;
}
else {
	d->type = NormalType; // Change: normal Type is not mentioned in the xml file!!!!!
}

Handover from QtXlsxWriter

Hi guys, I'm currently maintaining the fork of QtXlsxWriter that is most "popular" to keep it working. Unfortunately however I have not been able to dedicate to it the time I wanted to. Would you be interested in taking over the ownership of that repo and either merge or disband it once you are comfortable there are no further gaps between QXlsx and the old QtXlsxWriter?

Request for participation

In the past i used the QtXlsxWriter from "https://github.com/dbzhang800/QtXlsxWriter"
But your fork is more actual.
For my needs I have extended the chart a bit.
Extended handling for two-dimensional table with vertical and horizontal header. And swap the Header.
Also the activation of gridlines and legends.

Can I/may I check the extensions into a new branch?

Thank you

How to add to Qt?

can you please make a video or a tutorial how to use it. I had tried but too hard to use it.
thank you so much.

Numbers with 4 digits

In our project we try to get numbers(int and float) with 4 optional digits.

We used setNumberFormat with the String "0.####". The result is shown in the picture (Excel using german).

image

Is there a way to use setNumberFormat to get integers without the comma?

One question

Hello, I am a beginner, I want to use Qt to process EXCEL sheets, I like your library, also, I have never used github, so I would like to ask if there is any reference document about QXlsx?

Sheets, rows and columns iteration

I'm just wondering whether there's a way to iterate among the sheets, rows and columns. Because I could not find a way to get the number of rows and columns. Thanks!

Issues with QDateTime handling

Hi,
I have identified some possible issues with QDateTime handling. In the following test code I can construct a document in memory and write/read strings, but for QDateTime the values are different (it works fine for strings):

    QXlsx::Document doc;
    doc.addSheet("TestWorksheet");

    QVariant expected = QDateTime::currentDateTimeUtc();
    assert(doc.write("A1", expected));

    QVariant actual;
    auto cell = doc.cellAt("A1"); // get cell pointer.
    if ( cell != nullptr)
        actual = cell->readValue();

    qDebug() << (actual == expected ? "Values are the same" : "Values are Not the same");
    qDebug() << "Expected:" << expected.toString();
    qDebug() << "Actual:" << actual.toString();

Result:
Values are Not the same
Expected: "2019-10-11T09:22:47.233Z"
Actual: "43749.390824456015"

This is not an issue for me as I'm writing the document only, but it did throw me a bit.

Also note in the following test code I write to a file and then read it back again but the QDateTime is now empty:

    QString fileName = QUuid::createUuid().toString() + ".xlsx";
    QFile::remove(fileName);

    auto docW = new QXlsx::Document(fileName);
    docW->addSheet("TestWorksheet");

    QVariant expected = QDateTime::currentDateTimeUtc();
    assert(docW->write("A1", expected));

    docW->save();
    delete docW;

    auto docR = new QXlsx::Document(fileName);
    docR->load();

    QVariant actual;
    auto cell = docR->cellAt("A1"); // get cell pointer.
    if ( cell != nullptr)
        actual = cell->readValue();

    auto expectedTime = expected.toDateTime();
    auto actualTime = actual.toDateTime();
    qDebug() << (actualTime == expectedTime ? "Values are the same" : "Values are Not the same");
    qDebug() << "Expected:" << expectedTime.toString(Qt::DateFormat::ISODate);
    qDebug() << "Actual:" << actualTime.toString(Qt::DateFormat::ISODate);

    delete docR;
    QFile::remove(fileName);

Result:
Values are Not the same
Expected: "2019-10-11T09:22:27Z"
Actual: ""

I tracked this issue down the Cell::dateTime() method where dValue is always 0 because the variant is identified as a QDateTime and not a number.

It seems that QDateTime handling is broken; obviously it can be worked around by converting to strings, but this is a pain if serializing a QObject.

Thank you.
Kevin

Can not build through VS2015&Qt5.8.0 after I finished the configuration.

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: virtual int __cdecl QXlsx::Document::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@Document@QXlsx@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z) QtExecelTest D:\asher\project\QtExecelTest\QtExecelTest\xlsxdocument.obj 1

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: virtual struct QMetaObject const * __cdecl QXlsx::Document::metaObject(void)const " (?metaObject@Document@QXlsx@@UEBAPEBUQMetaObject@@xz) QtExecelTest D:\asher\project\QtExecelTest\QtExecelTest\xlsxdocument.obj 1

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: virtual void * __cdecl QXlsx::Document::qt_metacast(char const *)" (?qt_metacast@Document@QXlsx@@UEAAPEAXPEBD@Z) QtExecelTest D:\asher\project\QtExecelTest\QtExecelTest\xlsxdocument.obj 1

์ฐจํŠธ์ชฝ ์˜ˆ์ œ๊ฐ€ ์ •์ƒ๋™์ž‘ํ•˜์ง€์•Š์Šต๋‹ˆ๋‹ค (Chart example does not work)

Document xlsx;
for (int i=1; i<10; ++i) {
xlsx.write(i, 1, iii); //A1:A9
xlsx.write(i, 2, ii); //B1:B9
xlsx.write(i, 3, i
i-1); //C1:C9
}
//![0]

//![1]
Chart *pieChart = xlsx.insertChart(3, 3, QSize(300, 300));
pieChart->setChartType(Chart::CT_Pie);
pieChart->addSeries(CellRange("A1:A9"));
pieChart->addSeries(CellRange("B1:B9"));
pieChart->addSeries(CellRange("C1:C9"));


Chart *pie3DChart = xlsx.insertChart(3, 9, QSize(300, 300));
pie3DChart->setChartType(Chart::CT_Pie3D);
pie3DChart->addSeries(CellRange("A1:C9"));

Chart *barChart = xlsx.insertChart(23, 3, QSize(300, 300));
barChart->setChartType(Chart::CT_Bar);
barChart->addSeries(CellRange("A1:C9"));

Chart *bar3DChart = xlsx.insertChart(23, 9, QSize(300, 300));
bar3DChart->setChartType(Chart::CT_Bar3D);
bar3DChart->addSeries(CellRange("A1:C9"));

/*
Chart *lineChart = xlsx.insertChart(43, 3, QSize(300, 300));
lineChart->setChartType(Chart::CT_Line);
lineChart->addSeries(CellRange("A1:C9"));

Chart *line3DChart = xlsx.insertChart(43, 9, QSize(300, 300));
line3DChart->setChartType(Chart::CT_Line3D);
line3DChart->addSeries(CellRange("A1:C9"));

Chart *areaChart = xlsx.insertChart(63, 3, QSize(300, 300));
areaChart->setChartType(Chart::CT_Area);
areaChart->addSeries(CellRange("A1:C9"));

Chart *area3DChart = xlsx.insertChart(63, 9, QSize(300, 300));
area3DChart->setChartType(Chart::CT_Area3D);
area3DChart->addSeries(CellRange("A1:C9"));

*/
Chart *scatterChart = xlsx.insertChart(83, 3, QSize(300, 300));
scatterChart->setChartType(Chart::CT_Scatter);
//Will generate three lines.
scatterChart->addSeries(CellRange("A1:A9"));
scatterChart->addSeries(CellRange("B1:B9"));
scatterChart->addSeries(CellRange("C1:C9"));

Chart *scatterChart_2 = xlsx.insertChart(83, 9, QSize(300, 300));
scatterChart_2->setChartType(Chart::CT_Scatter);
//Will generate two lines.
scatterChart_2->addSeries(CellRange("A1:C9"));

Chart *doughnutChart = xlsx.insertChart(103, 3, QSize(300, 300));
doughnutChart->setChartType(Chart::CT_Doughnut);
doughnutChart->addSeries(CellRange("A1:C9"));

//![1]

//![2]
xlsx.saveAs("Book1.xlsx");
//![2]

์ƒ๋‹จ์˜ ์ฃผ์„ํ‘œ์‹œ๋œ ๋ถ€๋ถ„์˜ ์ฝ”๋“œ๋ฅผ ๋™์ž‘์‹œํ‚ค๋ฉด ์—‘์…€ํŒŒ์ผ์ด ๊นจ์กŒ๋‹ค๊ณ  ๋‚˜์˜ต๋‹ˆ๋‹ค.
ํ˜„์žฌ์ €๋Š” Office 2016์„ ์‚ฌ์šฉ์ค‘์ž…๋‹ˆ๋‹ค.
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

ASSERT error

Hello!

I try to open file with this code
Document xlsxR(fileName);
xlsxR.load()

ASSERT: "reader.name() == QLatin1String("pos")" in file ..\Test\source\xlsxdrawinganchor.cpp, line 124

File with error

QXlsx on Android

  • There was a question.

I find the QXlsx on github, it is great and faster than com method .
I have a question that can i use it on android by add in source code .
I have a small QT5 project need read excel file, i want build it to apk and running on android by QT5.11.0 for android.
Can QXlsx do it?
from jeff

  • Neither do I know. I have not run QXlsx on Android. I will try later if I have time. ๐Ÿ˜ญ

Is there any way to merge cells๏ผŸ

In qtableview there is a "setSpan" method to manage merged cells ,but my app is based on qml ,is there any way to merge cells in qml? I mean what can I do to "setSpan" in tableview?

lost data when open app again

Hi
i have one problem, example: first times i open app and write data to cell A1 and then closed app second times i open app again and write data to A2. the data in cell A1 lost.
please help me
thank you

Charts do not work properly

Hi j2doll!

I wrote a script to extract the data from the .txt file into .xslx and to draw the graphs. The script is that every new data set is extracted to the new sheet in an already existed .xslx file. The issue is that every time the script is adding the new sheet with the new data, the format of the previously created graphs appears to be lost. How it can be changed?

Thank you very much!!

https://app.leanboard.io/board/f7640887-b7e9-4762-b9ad-1dc99e6bba50

Write excel warning by QXlsx new problem

I got the warning when i write a excel (PLS refer attachment) as below codes

QXlsx::Document xlsx("d:/V1805133.xlsx");
if (!xlsx.isLoadPackage())
{
qDebug() << "Failed to load data.xlsx";

}else{
    if(xlsx.selectSheet("A")){

        qDebug() << xlsx.read("A1"); // QVariant(QString, "A1DATA")
        qDebug() << xlsx.read("A2"); // QVariant(Invalid)
        qDebug() << xlsx.read("B1"); // QVariant(QString, "B1DATA")
        qDebug() << xlsx.read("B2"); // QVariant(QString, "B2DATA")

        xlsx.write("E5", "Hello ");

        xlsx.save();
    }
}

if the excel file include a drawing , after writing as above , the drawing will be lose.

VBA will lose after write a xlsm type

XLSM type file contains VBA .
if write it the VBA will lose as below red mark
XLSMFILE
the vbProject.bin is lost in xlsm zip file
cloud you fix it?
Many thanks

Header and Footer are not read in and saved from existing excel file

If you read in an existing excel file with header and/or footer, they where not saved correctly.

I have changed following functions:
LoadFromXmlFile:

        } else if(reader.name() == QLatin1String("headerFooter")){					
			while (reader.readNextStartElement())
			{
				if (reader.name() == QLatin1String("oddHeader"))
					d->ModdHeader = reader.readElementText();

				if (reader.name() == QLatin1String("oddFooter"))
						d->MoodFooter = reader.readElementText();
			}

saveToXmlFile:

// headerFooter
if( !d->ModdHeader.isNull() || !d->MoodFooter.isNull())
{
    writer.writeStartElement(QStringLiteral("headerFooter")); // headerFooter  

	if (!d->ModdHeader.isNull())
	{
		writer.writeStartElement(QStringLiteral("oddHeader"));
		writer.writeAttribute(QStringLiteral("xml:space"), QStringLiteral("preserve"));
		writer.writeCharacters(d->ModdHeader);
		writer.writeEndElement();// t

		// writer.writeTextElement(QStringLiteral("oddHeader"), d->ModdHeader);
	}

	if (!d->MoodFooter.isNull())
	{
		writer.writeTextElement(QStringLiteral("oddFooter"), d->MoodFooter);
	}

    writer.writeEndElement();// headerFooter
}

after this changes you can read/write existing files with header and/or footer

Walter

suggestion for excel file print out on paper

Hi your projects QXlsx and Qlibxlsxwriter can read and write excel file well.
So i think maybe has a easy way to call some windows API and print out the excel file( of course OS to be installed office software ), because for a excel file we can click the "print item " in the pop menu by clicking right button of mouse .

CMake support

Hi there,

I'd like to include this library in a cmake based project. It would be great if QXlsx had also a CMakeLists.txt file to compile it as a target library rather than including directly its sources.
Is there any plan to add it or would you accept a PR in this sense otherwise?
Also, if you have any advise to make it work differently, please drop a line here. It would be appreciated.

series titles do not display on chart sheets

Hi, This is a great extension, thanks very much for sharing!

Just a couple of issues.

  1. When creating a chart sheet, I can not display the series titles. The chart title work fine though.

  2. Is there a way to create a legend, ideally using the first cell value in the range?

  3. Is there a way to use a cell range as your x axis range, (for instance, time in seconds)?

    VSR_excelExport->addSheet("Plots_Chart",AbstractSheet::ST_ChartSheet);
    Chartsheet *sheet = static_cast<Chartsheet*>(VSR_excelExport->currentSheet());
    Chart *lineChart = sheet->chart();

    lineChart->setChartType(Chart::CT_Surface3D);

    lineChart->setChartTitle(profile_filename_raw);

all work fine, but the next line seems to get lost, regardless of where I position it.
lineChart->setAxisTitle(Chart::ChartAxisPos::Right, "Time in Seconds");

Thanks again!!

rick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.