Giter VIP home page Giter VIP logo

Comments (5)

dbzhang800 avatar dbzhang800 commented on May 18, 2024

The issue is the same as #31. But I don't know how to solve the issue at present.

  1. A more powerful zib library is needed to solve this problem, stream read and write supported is required by each part the .xlsx package(zip package). Or we can extract the .xlsx package to a temp directory, then create new .xlsx package based on the temp directory.
  2. Keeps only one row or several rows of cells in the memory. It is not very difficult to implement this for a pure XlsxWriter or pure XlsxReader library, but I still have no idea how to implement this for XlsxReadWriter library.

from qtxlsxwriter.

dushibaiyu avatar dushibaiyu commented on May 18, 2024

I Think do we Write All XML File to Tmp folder,When Closing ,Write to the Xlsx(zip)。
When read :
Frist : UnZip to a folder。
Then: read Xml?
您在北京是吗?资料上是,我英文十分差、、
就是把两步分开做呢?libzip能满足压缩的需求吗?引用下呢?有人做了个quazip把zip封装成了Qt的接口。
我遇到问题也去简单看了下openXML的简单介绍和组成,只是菜鸟对XML操作还不大熟练呢。
这也只是我这一点点了解的想法,可能有点离谱,勿怪、、
现在我感觉需要优化下的、、我写5M左右的文件,内存可以占用到130+的、、在win下、、写入70M左右的文件就直接很慢而且写不进、、

from qtxlsxwriter.

dbzhang800 avatar dbzhang800 commented on May 18, 2024

主要是Qt提供的QZipReader/QZipWriter 功能太弱了,它后台使用的 zlib 压缩解压是完全没问题的。另一个选择是KDE中的KArchive,可是它和quazip都是LGPL协议的。

解压到临时文件夹是大部分 xlsx 类库采用的做法,比如python的 xlsxwriter 等。而后直接操作哪些xml文件。QtXlsx当前的实现是,所有这些文件解压后都放到了内存中了。

单纯实现对大xlsx文件的读操作,或者写操作,都不是太困难,要支持读写(即修改已有文件) 就很困难了。比如python的 openpyxl类库,也是专门提供额外的读或者写的机制
https://pythonhosted.org/openpyxl/optimized.html

生成xlsx大文件的要点就是,一旦有cell数据,就要立即写入到对应的xml文件中(而不是像QtXlsx现在,所有数据都在内存中,调用save时,才写入文件,而且写入文件后我们并不删除内存中的数据)。但是缺点就是,你只能按行追加内容,而不能插入内容。比如你先写第10行,又写了第14行,此时你又想在12行写入东西,就不行。

另外,如果你要写入大量字符串,而这些字符串重复的又很少,使用InlineString 速度上会快得多。

from qtxlsxwriter.

dushibaiyu avatar dushibaiyu commented on May 18, 2024

这样啊、、那样可以新建个分支专门针对顺序的读写呢?现在的机制还保留,或者判断文件大小选择读取方式,写入方式加个选项?
LGPL协议很好啊、、我最喜欢的就是LGPL V2了、、现在Qt Xlsx是什么协议啊?好像是自定义的协议?
只是如果我们连接了LGPL协议的也是可以的啊、、只是安装时需要说明需要这两个库,至于这两个库需要用户自己解决的、、

from qtxlsxwriter.

dbzhang800 avatar dbzhang800 commented on May 18, 2024

嗯,开新的分支来实现新的特性是没问题的,不过我现在没有时间做这个事情,你可以先试着做一下。

现在Qt Xlsx采用的是比LGPL更开放的MIT协议,所以用户可以直接将源码集成到他们的私有程序中。

from qtxlsxwriter.

Related Issues (20)

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.