QtXlsxWriter
QtXlsxWriter copied to clipboard
File corrupted after calling insertImage()
Calling insertImage() or insertChart() leads to creating corrupted file. Microsoft Excel shows warning when trying to open file: "We found a problem with some content in 'filename.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes." Clicking 'Yes' results in an empty file. dbzhang800's code works fine, except for QList/QVector thing in xlsxzipreader.cpp.
Very strange, we made no change to the code that handles images from the original library. Can you share a minimal example to reproduce the problem?
This example shows, that insertImage() works fine with original library. But insertChart() doesn't work with both yours and dbzhang800's. qtxlsx-example.zip
You need to actually put some "Logo.jpeg" to the build directory
First, thanks for the lib. It's a much better solution than make my app generate a python script depending on pyExcelerator !
But ...
I have the same problem: as soon as there is an image in a generated .xlsx file, Excel complains. In a multi sheet document, pure text sheets are OK, but sheets containing image(s) are ending blank.
I can provide you with the .xlsx file, but I don't want to make it public. I could remove the sensitive information, but I don't want to alter the file. Is it possible on a private channel ?
I'm developing under Linux for a Linux colorimetry test bench. I made all my dev tests using LibreOffice under Linux, without any problem. But as soon as I tested in real conditions, which means sending the file to Windows users depending on Excel 2010, we encountered the problem.
At least, here is the "repair report" from Excel:
It's in French and it won't help a lot I'm afraid.
Very strange, we made no change to the code that handles images from the original library. Can you share a minimal example to reproduce the problem?
I remember this bug was resolved on https://github.com/QtExcel/QXlsx you can check the code and patch on your project.
That was quick, thanks !
I did not realized I was using a outdated version. I thought I was using a fork or something. Strange.
Anyway, I'm about to check https://github.com/QtExcel/QXlsx and adapt my code if necessary. I will keep you updated.
So far, so good. Many thanks again ! API is the same, no adjustment required.
I found a lot of warnings though. I could propose a correction. But I'm not familiar with GitHub and how to push code. Is there a tutorial that explain how I can push, or send a patch or something ? (before I google that myself ... No time right now, sorry)
https://github.com/QtExcel/QXlsx is not a fork to this project. The initial design of this library, however, makes it almost impossible to develop advanced functionality. My suggestion would be to abandon this library and move on to the one actively developed