PDA

View Full Version : how I make reports in Qt like as crystal reports in .net and export to pdf



subodh
22nd July 2011, 07:04
How I generates reports in qt, I want to show print preview of reports in qt. Like as crystal reports in .net or vb.

pls help or suggest any other way to this ?:confused:

ChrisW67
22nd July 2011, 07:35
There is no high level automagic report generator in out-of-the-box Qt.

Printing support is: Open a QPrinter, use QPrinter::setOutputFormat() and QPrinter::setOutputFileName(), and use a QPainter to put whatever you want on the pages. See Printing with Qt

There are third-party libraries that might do some of what you want. http://www.ics.com/products/qt/addons/ (not an endorsement)

pkj
22nd July 2011, 13:17
You might look at NCReports too. Or KDReports. But since they are based QPainter they lack inherently the capability to export in excel formats or even odf formats. Then they have not integrated qwt, so for graphs, you will have to create it and use it as image. As Chris rightly said, definitely not out of the box. You may want to look to java for this if data is to pulled from some database.

aliks-os
22nd March 2014, 20:14
Try QtRPT with QtRptDesigner
https://sourceforge.net/projects/qtrpt/