Coder Social home page Coder Social logo

qtexcel / qxlnt Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 22.0 4.8 MB

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

QMake 0.91% C++ 81.44% CMake 2.46% C 11.71% EJS 0.01% JavaScript 0.17% Roff 2.77% Python 0.53%
cpp excel qt xlnt xlsx

qxlnt's People

Contributors

j2doll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qxlnt's Issues

eruer

why when use the libray for modifie file xlsx
After run the code the file corupted
The solution for proteced the file befor writing

App crash when linked with both Qxlnt and QWebWidget

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

  • xlnt/third-party/libstudxml/libstudxml/parser.cxx
  • xlnt//third-party/libstudxml/libstudxml/details/expat/xmlparse.c
  • xlnt/third-party/libstudxml/libstudxml/details/expat/expat.h

For convenience I attached the bash script I used to do this patching. Run it from the xlnt directory.

Reading file issue

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?

corrupted file when save using password

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

build error

Build HelloQXlnt in sourecode.
Environment:QtCreator4.0.3,Qt5.6.3 MinGW32,compiler MinGW4.9.2 32bit,system windows10
image
Looks like the overload function is missing

Read cell value have formula

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!

HelloQXlnt.pro build failure

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

How to setup QxInt in visual studio?

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.

Can't read a file in Windows, Qt creator

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 ํŒŒ์ผ์„ ๋ชป ๋ถˆ๋Ÿฌ์˜ค๋Š”๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
image

image

๋‹ค๋ฅธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ธ Qxlsx๋Š” ์ธ์‹์ด ์ž˜ ๋˜๋Š”๋ฐ Qxlnt๋Š” ์ฒ˜์Œ ์‚ฌ์šฉํ•ด๋ด์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜๋ฅผ ์ œ๊ฐ€ ์ž˜๋ชปํ•œ๊ฑด์ง€ ์•Œ ์ˆ˜ ์žˆ์„๊นŒ์š”?

Hi!

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

Bug

why when use the libray for modifie file xlsx
After run the code the file corupted
The solution for proteced the file befor writing

read excel darwin error

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.

cell is date type , but read out is wrong

The excel file cell is

image

use qt to read out it by QString::fromStdString(ws.cell("B13").to_string())

but got string "44733", how can i to get correct date from excel cell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.