qtexcel / qxlnt Goto Github PK
View Code? Open in Web Editor NEWUse xlnt in Qt 5 or 6. xlnt is cross-platform user-friendly xlsx library for C++1x.
Home Page: https://qtexcel.github.io/Qxlnt/
License: MIT License
Use xlnt in Qt 5 or 6. xlnt is cross-platform user-friendly xlsx library for C++1x.
Home Page: https://qtexcel.github.io/Qxlnt/
License: MIT License
why when use the libray for modifie file xlsx
After run the code the file corupted
The solution for proteced the file befor writing
fix_expat_c_code.sh.txt
Maybe someone else might find this useful.
I use Qxlnt (many thanks for the author) with QWebWidget in my Qt app (Qt 5.15.2, to be precise). My problem was the app crashing with sigsegv (I used Linux, but I think the problem pops up on other platforms, too) when linked against libQxlnt.a. The chrash happens in the QApplication constructor in a function called XML_ParseBuffer.
After some scratching of my head and consulting the linker map it turned out that the culprit is the C code in Expat xml parser. Probably the names of the functions (starting with XML_) conflict with some functions in the QWebWidget and the linker adds these functions from libQxlnt. The solution was that I renamed all the C functions in
For convenience I attached the bash script I used to do this patching. Run it from the xlnt directory.
Hi,
I am trying to execute the code for the simple example that you posted for reading from an existing file but I get an error on Mac. Do you know why this is?
Hello,
I need to protect the output file but when I'm using:
wb.save(filename);
it work fine, save without problem but when I'm using
wb.save(filename, password);
the file is created, the size is fine but I can not open it, when I try to do, excel program is opening virgin, no any sheet, just empty.
I'm under windows 10, Qt 5.15.1 32 bit MSVC2019, with pro file config with c++ 14.
Could you help me please?
Thank you very much
Hello, if cell have formula how to get cell value (not return formula) use Qxln๏ผ
sample code:
xlsn::path file = xlsn::path("text.xlsx");
xlsn::workbook wb(file);
auto ws = wb.sheet_by_title("Total");
auto cell = ws.cell(1,3);
qDebug() << "val is " <<QString::fromStdString(cell.valuestd::string());
but return value is SUM(A1:A2)๏ผnot number string value
thank very much!
The error is ๐ error: LNK1181: can't open input file โ..\Qxlnt\release\QXlnt.libโ
If build QXlint.lib and put release folder , a lot of error about static lib and dll .
Seems too many level for include pri file.
Best regards,
jeff
Hello im a bit confused on how this library is added to visual studio 2019. Where do i need to put the repository, do i have to copy it to my project. I would like a guide if possible.
๐จ enchantment : print xlsx as a printer
from jeff
Hi.
I have that xlnt can't read the excel file in Windows 10, 64 bits. I'm using Qt creator, but I'm relatively new to modern code.
Some code:
#include "widget.h"
#include "ui_widget.h"
#include "persona_reducida.h"
#include "personadialog.h"
#include "listadobusq_o_err_dialog.h"
#include "filtro.h"
#include <operaciones_con_qstrings.h>
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include <xlnt/xlnt.hpp>
using namespace std;
...
void Widget::on_abrir_clicked()
{
QFileDialog fd;//--------------------------------caja de dialogo para que tome el excel
fd.setDefaultSuffix(".xlsx");
fd.setDirectory(QDir::homePath());
nombre_de_file = fd.getOpenFileName();
// nombre_de_file = nombre_de_file.split("/").join("\"); // first try
// nombre_de_file.insert(nombre_de_file.indexOf("\"), "\");
nombre_de_file.insert(nombre_de_file.indexOf("/"), "/"); // second try
if (nombre_de_file.isEmpty() || nombre_de_file.isNull())
{
nombre_de_file= filename_anterior;
ui->espere_cartel->hide(); ui->progressBar->hide();
return;
}
QFileInfo archinfo;
archinfo.setFile(nombre_de_file);
if (archinfo.suffix().contains("xls") == false){
QMessageBox::critical(this, "Error: no es un archivo Excel",
"El archivo seleccionado no es un archivo Excel como se espera. Seleccione correctamente el archivo.");
nombre_de_file = "";
ui->espere_cartel->hide();
ui->progressBar->hide();return; //salir
}
xlnt::path ruta(nombre_de_file.toStdString());
xlnt::workbook xlsx; //solo para leer la informacion
try{
xlsx.load(ruta); // Here *********************************** an exception
}catch(...)
{
mSystemTrayIcon->showMessage("Nuevo Mensaje",
"Hay un mensaje de error para usted en el Control de Embarazadas.");
QString s1 = e.what();
QMessageBox::critical(nullptr,
"Error de archivo",
"Exception: "+
s1 +
". Error al abrir el archivo. Esto puede deberse a que otro programa tiene abierto el archivo, o se ha generado una excepciรณn. Si es asรญ, trate de cerrar el archivo en el otro programa primero.");
nombre_de_file = "";
ui->abrir->setEnabled(0);
ui->espere_cartel->hide();
ui->progressBar->hide();return; //salir
}
...
It generate an exception in the load line:
in my first try, xlnt::exception File not found F:\new folder\example.xlsx
second try , xlnt::exception File not found F:\new folder\example.xlsx
third try: xlnt::exception File not found F://new folder/example.xlsx
four try: xlnt::exception File not found F:/new folder/example.xlsx
I'll thanks a lot if somebody can help me.
์๋ ํ์ธ์. ๋ ธ๊ณ ๊ฐ ๋ง์ผ์ญ๋๋ค
๊ฐ๋ฐํ๊ฒฝ์
windows 11 64bit
visual studio studio 2022
qt 5.15.2
MSVC2019 64bit
์ฌ์ฉํ๊ณ ์์ต๋๋ค.
์ ๊ฐ ์ฌ์ฉํ๊ณ ์๋ ํ๋ก์ ํธ .pro ํ์ผ์
include(./Qxlnt/Qxlnt/Qxlnt.pri)
๋ฅผ ์
๋ ฅํ๊ณ ๋ฃ์๋๋ ์ธ์์ ๋๋๋ฐ header ์ sources ํ์ผ์ ๋ชป ๋ถ๋ฌ์ค๋๊ฑฐ ๊ฐ์ต๋๋ค.
๋ค๋ฅธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ธ Qxlsx๋ ์ธ์์ด ์ ๋๋๋ฐ Qxlnt๋ ์ฒ์ ์ฌ์ฉํด๋ด์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น๋ฅผ ์ ๊ฐ ์๋ชปํ๊ฑด์ง ์ ์ ์์๊น์?
Hi!
I was looking throught your library and testing some formula and found some trouble with SUMIF.
I triy it like this -> ws.cell("C3").value("=SOMMA.SE($A$1:$A$10;""">0)"");
but it's obviously giving me error beacuse of the apostrophes
Can u pls explain it to me pls?
Thanks
Hi, I was getting errors when reading some files, so I tried the HelloQXlnt. It seems that there is a bug when trying to read copied function cells. I'm on Windows 10. This is the simple code I used and the Excel file :
example.xlsx
why when use the libray for modifie file xlsx
After run the code the file corupted
The solution for proteced the file befor writing
Cuando leo un excel y trato de copiarlo a otro excel. Muesta el siguiente error Parte /xl/drawings/drawing1.xml. (Forma de dibujo). En el excel donde se copia, al abrirlo en la hoja de esta el grafico de barra, el grafico no es copiado.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.