1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-16 04:42:53 +08:00
QXlsx/README.md

103 lines
4.4 KiB
Markdown
Raw Normal View History

2018-05-26 12:20:33 +09:00
# QXlsx
2017-08-20 17:04:19 +09:00
2018-05-11 14:39:38 +09:00
> *Read this in other languages: [English](README.md), :kr: [한국어](README.ko.md)*
2017-08-20 17:04:19 +09:00
2018-10-23 16:24:42 +09:00
<p align="center"><img src="https://github.com/j2doll/QXlsx/raw/master/markdown.data/QXlsx-Desktop.png"></p>
2017-10-05 14:35:06 +09:00
2018-07-16 17:07:51 +09:00
- 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.
2018-06-23 15:46:14 +09:00
2018-07-16 17:10:59 +09:00
## How to use
2018-11-17 16:27:43 +09:00
- See [examples](Example.md)
- HelloWorld : Hello world example (The most basic structure)
2018-07-27 10:38:54 +09:00
- TestExcel : basic samples based on QtXlsx samples
2018-09-28 21:20:29 +09:00
- HelloAndroid : read xlsx on Android using QML
2018-10-05 13:06:39 +09:00
- Copycat : load xlsx file and display on widget. print xlsx file. (TODO: save xlsx)
2018-11-15 10:59:07 +09:00
- WebServer : load xlsx and display to web (`http://127.0.0.1:3001`)
2018-09-28 21:20:29 +09:00
2018-12-04 20:06:27 +09:00
### Example (Hello excel)
2018-04-19 16:36:59 +09:00
2018-12-04 20:06:27 +09:00
#### :one: Writing excel file(*.xlsx)
2018-07-16 17:07:51 +09:00
2017-10-09 21:08:32 +09:00
```cpp
QXlsx::Document xlsx;
2017-10-17 18:34:37 +09:00
xlsx.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string.
xlsx.saveAs("Test.xlsx"); // save the document as 'Test.xlsx'
2017-10-09 21:08:32 +09:00
```
2018-04-19 16:36:59 +09:00
2018-12-04 20:06:27 +09:00
#### :two: Reading excel file(*.xlsx)
2018-07-16 17:07:51 +09:00
2017-10-09 21:08:32 +09:00
```cpp
2017-10-17 19:01:47 +09:00
Document xlsx("Test.xlsx"); // load excel file
2018-06-11 13:40:38 +09:00
if (!xlsx.isLoadPackage()) {
return; // failed to load excel
2017-10-17 19:01:47 +09:00
}
2017-10-17 19:02:56 +09:00
int row = 1; int col = 2;
Cell* cell = xlsx.cellAt(row, col); // get cell pointer. (row is 1. column is 2.)
2017-10-09 21:08:32 +09:00
if ( cell == NULL )
2017-10-21 16:41:24 +09:00
continue; // cell vaule is not set
2017-10-17 18:33:26 +09:00
QVariant var = cell->readValue(); // read cell value (number(double), QDateTime, QString ...)
2018-06-14 15:04:37 +09:00
qDebug() << var; // display value
2017-10-09 21:08:32 +09:00
```
2018-12-04 20:06:27 +09:00
## How to set up (Installation)
- See [how to setup QXlsx project](HowToSetProject.md)
2018-11-17 16:27:43 +09:00
## Tested environment
2018-06-23 15:36:09 +09:00
2018-11-30 15:24:12 +09:00
Travis CI | AppVeyor
:-------: | :-------:
2018-11-30 15:12:10 +09:00
[![Build Status](https://travis-ci.com/j2doll/QXlsx.svg?branch=master)](https://travis-ci.com/j2doll/QXlsx) | [![Build status](https://ci.appveyor.com/api/projects/status/jkod8257gg66vm6e?svg=true)](https://ci.appveyor.com/project/j2doll/qxlsx)
2018-11-17 16:27:43 +09:00
- See [tested environments](TestEnv.md)
2017-10-17 18:48:33 +09:00
## To Do
2018-06-14 15:48:31 +09:00
- [To test](ToTest.md)
2018-11-17 16:27:43 +09:00
- [What to upgrade](ToUpgrade.md).
2018-11-15 10:58:13 +09:00
## Contributions
2018-11-17 16:27:43 +09:00
2018-11-15 10:58:13 +09:00
- See [contributors](https://github.com/j2doll/QXlsx/graphs/contributors).
2018-06-04 14:09:56 +09:00
2018-06-26 20:38:09 +09:00
## License and links
2018-11-12 13:42:42 +09:00
- QXlsx is under MIT license. [https://github.com/j2doll/QXlsx](https://github.com/j2doll/QXlsx)
- QtXlsx is under MIT license. [https://github.com/dbzhang800/QtXlsxWriter](https://github.com/dbzhang800/QtXlsxWriter)
- Qt-Table-Printer is under BSD 3-Clause license. [https://github.com/T0ny0/Qt-Table-Printer](https://github.com/T0ny0/Qt-Table-Printer)
2018-11-14 14:01:22 +09:00
- recurse is under MIT license. [https://github.com/pkoretic/recurse](https://github.com/pkoretic/recurse)
2018-11-12 13:42:42 +09:00
- Qt is under LGPL v3 license or Commercial license. [https://www.qt.io/](https://www.qt.io/)
2018-06-23 15:17:25 +09:00
2018-06-23 15:59:50 +09:00
## :email: Contact
2018-07-16 17:07:51 +09:00
- Hi! I'm j2doll (aka Jay Two). My name is Korean and it is difficult for foreigners to pronounce it. Call me j2doll.
- Leave me a issue. [https://github.com/j2doll/QXlsx/issues](https://github.com/j2doll/QXlsx/issues)
2018-06-11 13:40:38 +09:00
- If you are interested in participating in the project, please contact us by issue.
2018-06-17 18:30:31 +09:00
- My native language is not English and my English is not fluent. Please, use EASY English. :-)
2018-11-12 13:42:42 +09:00
- 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)
2018-06-17 18:30:31 +09:00
2018-06-28 16:05:55 +09:00
## Similar projects
2018-07-05 16:00:50 +09:00
### :star: <b>Qxlnt</b> [https://github.com/j2doll/Qxlnt](https://github.com/j2doll/Qxlnt)
2018-07-05 16:08:12 +09:00
<p align="center"><img src="https://github.com/j2doll/Qxlnt/raw/master/markdown-data/Concept-QXlnt.jpg"></p>
2018-07-05 16:00:50 +09:00
- Qxlnt is a helper project that allows xlnt to be used in Qt.
2018-07-05 16:26:47 +09:00
- xlnt is a excellent C++ library for using xlsx Excel files. :+1:
2018-07-05 16:00:50 +09:00
- 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.
### :star: <b>Qlibxlsxwriter</b> [https://github.com/j2doll/Qlibxlsxwriter](https://github.com/j2doll/Qlibxlsxwriter)
2018-07-05 16:08:12 +09:00
<p align="center"><img src="https://github.com/j2doll/Qlibxlsxwriter/raw/master/markdown.data/logo.png"></p>
2018-07-05 16:00:50 +09:00
- Qlibxlsxwriter is a helper project that allows libxlsxwriter to be used in Qt.
- libxlsxwriter is a C library for creating Excel XLSX files.
2018-06-28 16:05:55 +09:00
2018-10-28 17:02:43 +09:00
### :star: <b>QSimpleXlsxWriter</b> [https://github.com/j2doll/QSimpleXlsxWriter](https://github.com/j2doll/QSimpleXlsxWriter)
- Use SimpleXlsxWriter in Qt.
- SimpleXlsxWriter is C++ library for creating XLSX files for MS Excel 2007 and above.