Editing a spreadsheet
-
Hi,
I want to edit a spreadsheet (Excel file) and keep the presentation (color, invisible cells,..) because i need to print the table after editing it.
What is the best way to handle this with Qt ? Convert to HTML ? to csv ? to xml ?
I'm open to any suggestions :)Thanks
-
Hi
If you can just select the excel XML format, i would go that route.
Then just load it as pure xml and change what you need.But it depends on what you need to change. if you must do massive changes, xml is annoying as u must add nodes etc the right places.
-
For xlsx files you can try using QtXlsxWriter. it might loose some of the contents of the file if it's very complex so I'd give it a test run.
-
Yep my bad,
But when i include the .pri file i get compiling error about a QVectorQZipReader::FileInfo in the ZipReader::init function
-
@Zoptune The library has no rendering functionality i.e. has no tool to "paint" the excel document, just to edit its parts. If you have excel installed on the machine that should print the file you can try this solution and use QProcess in your program to launch the WScript.exe
-
@VRonin Yep, this is solution i have seen yesterday, but i don't want to have Excel installed so i use a QProcess that launch LibreOffice to do a convertion in a pdf file and then print the pdf from my app.
I'm trying to find if it is possible with QtXlsx to change the document orientation (i need it to be in landscape format).Thx
-
There is a pull request on the main project that implements the feature. The author did not submit it to my fork so I did not review and merged it yet but feel free to try it