excel操作封装
更多...
#include <DAAxObjectExcelWrapper.h>
|
| class | PrivateData |
| | The DAAxObjectExcelWrapper::PrivateData class
|
| |
|
|
static DATable< QVariant > | readExcelSheet (const QString &filename, int sheetIndex=0, QString *errString=nullptr) |
| |
|
static bool | writeExcel (const QString &filename, const QString &sheetName, const DATable< QVariant > &table, bool appendLast=false, QString *errString=nullptr) |
| |
excel操作封装
写操作如下
QString excelPath = "./file.xlsx";
...make table
excel.saveAs(excelPath);
针对excelSheet的操作封装,不对QAxObject的生命周期进行管理,确保此类不要单独保留,否则sheet析构后会引起异常
Definition DAAxObjectExcelSheetWrapper.h:14
bool writeTable(const DATable< QVariant > &table, int startRow=1, int startColumn=1)
写表
Definition DAAxObjectExcelSheetWrapper.cpp:159
excel操作封装
Definition DAAxObjectExcelWrapper.h:28
支持稀疏存储和各种算法的表格类
Definition DATable.hpp:26
◆ addSheet()
◆ create()
| bool DA::DAAxObjectExcelWrapper::create |
( |
const QString & |
filename, |
|
|
bool |
visible = false, |
|
|
bool |
displayAlerts = false |
|
) |
| |
打开excel
- 参数
-
| filename | excel文件名 |
| visible | 是否可见 |
| displayAlerts | 是否显示警告 |
- 返回
- 成功返回true
◆ getActiveSheet()
◆ getActiveSheetName()
| QString DA::DAAxObjectExcelWrapper::getActiveSheetName |
( |
| ) |
const |
◆ getSheet()
◆ getSheetsCount()
| int DA::DAAxObjectExcelWrapper::getSheetsCount |
( |
| ) |
const |
◆ getSheetsName()
| QStringList DA::DAAxObjectExcelWrapper::getSheetsName |
( |
| ) |
const |
◆ indexOfSheetName()
| int DA::DAAxObjectExcelWrapper::indexOfSheetName |
( |
const QString & |
name | ) |
const |
◆ open()
| bool DA::DAAxObjectExcelWrapper::open |
( |
const QString & |
filename, |
|
|
bool |
visible = false, |
|
|
bool |
displayAlerts = false |
|
) |
| |
打开excel
- 参数
-
| filename | excel文件名 |
| visible | 是否可见 |
| displayAlerts | 是否显示警告 |
- 返回
- 成功返回true
- 注解
- 如果没有excel文件,此函数会返回false
◆ readTable()
| DATable< QVariant > DA::DAAxObjectExcelWrapper::readTable |
( |
int |
sheetIndex | ) |
const |
◆ setCurrentSheet() [1/2]
| bool DA::DAAxObjectExcelWrapper::setCurrentSheet |
( |
const QString & |
name | ) |
|
◆ setCurrentSheet() [2/2]
| bool DA::DAAxObjectExcelWrapper::setCurrentSheet |
( |
int |
index | ) |
|
◆ setDisplayAlerts()
| void DA::DAAxObjectExcelWrapper::setDisplayAlerts |
( |
bool |
on | ) |
|
◆ setWindowVisible()
| void DA::DAAxObjectExcelWrapper::setWindowVisible |
( |
bool |
on | ) |
|
该类的文档由以下文件生成:
- /home/runner/work/data-workbench/data-workbench/src/DAAxOfficeWrapper/DAAxObjectExcelWrapper.h
- /home/runner/work/data-workbench/data-workbench/src/DAAxOfficeWrapper/DAAxObjectExcelWrapper.cpp