converting excel sheet to pdf in qt cpp
-
@harsha123
Hello and welcome.You need to provide more context about your environment and what exactly you want to achieve. For example, I see at least 3 high-level approcahes you may be starting from:
-
You are running under Windows, and wish to use Automation to talk from your Qt app to a running Excel program to ask it to select the sheet and do the printing for you.
-
You have a
.xls
/.xlsx
saved file and want to read that in and print it. (And then you have the sub-issue of how much formatting you expect to be respected, e.g. column widths.) -
You have exported a
.csv
file and want to read that and print a table from it.
-
-
@harsha123
I do not think there is a C++ library for Qt which can read a.xlsx
and understand enough about it to actually render/print/export to PDF. I think at best it can parse it. There may be a library for Python which can accomplish this, but not C++.I stand to be corrected by someone more knowledgeable, I may be mistaken.
Maybe I am wrong. What about https://qtexcel.github.io/QXlsx/ ? I see it has
Qt-Table-Printer is under BSD 3-Clause license. https://github.com/T0ny0/Qt-Table-Printer
at https://github.com/T0ny0/Qt-Table-Printer. Maybe that can leveraged to produce PDF file (which is why I talked abour "printing" earlier, do print-to-PDF-file).
-
This post is deleted!