Skip to content

QtExcel/Qxlnt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

df2c366 Β· Feb 16, 2023
Aug 20, 2019
Feb 16, 2023
Feb 16, 2023
Feb 12, 2023
Jun 26, 2018
Feb 10, 2023
Oct 26, 2018
Oct 4, 2019
Feb 16, 2023
Feb 12, 2023
Feb 16, 2023
Feb 16, 2023
Feb 12, 2023
Aug 13, 2019

Repository files navigation

Qxlnt

Read this in other languages: English, πŸ‡°πŸ‡· ν•œκ΅­μ–΄

  • Qxlnt is a helper project that allows xlnt to be used in Qt.
  • xlnt is xlsx library that using C++1x. See 'License and links' for more information.

Why did you make it?

  • xlnt is a excellent 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.

Hello World (HelloQXlnt)

1️⃣ 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;
}

2️⃣ 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

  • Testing in various Qt environments. ☁️
  • Unicode Test (filename, file path, data value) β˜”

License and links

πŸ“« Contact

Similar projects

  • QXlsx is excel file(*.xlsx) reader/writer library.
  • Because QtXlsx is no longer supported(2014), 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.

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