QtExcel / Qxlnt

Use xlnt in Qt 5 or 6. xlnt is cross-platform user-friendly xlsx library for C++1x.
https://qtexcel.github.io/Qxlnt/
MIT License
80 stars 23 forks source link
cpp excel qt xlnt xlsx

Qxlnt

Read this in other languages: English, :kr: 한국어

Why did you make it?

Hello World (HelloQXlnt)

:one: Writing a excel(xlsx) file

#include <iostream>
#include <xlnt/xlnt.hpp>
#include <QCoreApplication>

int main(int argc, char **argv)
{     
    QCoreApplication a(argc, argv); // It is a Qt code.

    xlnt::workbook wb; // It is a xlnt code. Mix it together!
    xlnt::worksheet ws = wb.active_sheet();
    ws.cell("A1").value(5);
    ws.cell("B2").value("string data");
    ws.cell("C3").formula("=RAND()");
    ws.merge_cells("C3:C4");
    ws.freeze_panes("B2");
    wb.save("example.xlsx");

    return 0;
}

:two: Reading from an existing xlsx spread sheet.

// https://tfussell.gitbooks.io/xlnt/content/docs/introduction/Examples.html

xlnt::workbook wb;
wb.load("/home/timothymccallum/test.xlsx");
auto ws = wb.active_sheet();
std::clog << "Processing spread sheet" << std::endl;
for (auto row : ws.rows(false)) 
{ 
    for (auto cell : row) 
    { 
        std::clog << cell.to_string() << std::endl;
    }
}
std::clog << "Processing complete" << std::endl;

Notice

Test

Travis CI
Build Status

To Do

License and links

:mailbox: Contact

Similar projects

:star: QXlsx https://github.com/QtExcel/QXlsx

:star: Qlibxlsxwriter https://github.com/QtExcel/Qlibxlsxwriter

:star: QSimpleXlsxWriter https://github.com/QtExcel/QSimpleXlsxWriter