Member Function Documentation
QtRPT::QtRPT(QObject * parent = 0)
Constructs a QtRPT object with the given parent.
QtRPT::~QtRPT()
Destroys the object, deleting all its child objects.
void QtRPT::clearObject()
Destroy all objects and clear the report.
[protected]
bool QtRPT::eventFilter(QObject * obj, QEvent * e)
Filters events if this object has been installed as an event filter for the obj.
In your reimplementation of this function, if you want to filter the e out, i.e. stop it b
Returns value
from reimplemented function.
Reimplemented from QObject::eventFilter()
[static]
QList<FieldType> QtRPT::getDrawingFields()
Return the QList contains the type of fields which acts as a drawing fields. The following fields are a drawing:
- Circle
- Triangle
- Rhombus
- RoundedReactangle
- Reactangle
[static]
FieldType QtRPT::getFieldType(QDomElement e)
Return field's type of given QDomElement e which represents a field
See also getFieldTypeName().
[static]
QString QtRPT::getFieldTypeName(FieldType type)
Return the field's type name for given type
See also getFieldType().
[static]
Qt::PenStyle QtRPT::getPenStyle(QString value)
Convert and return Pen style of field for given value
bool QtRPT::loadReport(QString fileName)
Loads report from XML file with fileName. Returns true
if loading is success
bool QtRPT::loadReport(QDomDocument xmlDoc)
This is an overloaded function.
Loads report from QDomDocument xmlDoc. Returns true
if loading is success
[signal]
void QtRPT::newPage(int page)
This signal is emitted when the new page generated. page is a number of new page.
void QtRPT::printExec(bool maximum = false, bool direct = false, QString printerName = QString())
Open preview of the report in maximize or fitted mode. Or you can print report without preview. To open preview in maximize mode, set maximum to true.
report->printExec(true,false);
To direct printing without preview dialog, set direct to true.
report->printExec(true,true);
If printer with the printerName is not valid, the default printer will be used.
See also printPDF(), printHTML(), and printODT().
void QtRPT::printHTML(const QString & filePath, bool open = true)
Print report direct to HTML file by filePath. Second param open indicates open or not after printing a pdf file.
See also printExec(), printPDF(), and printODT().
void QtRPT::printODT(const QString & filePath, bool open = true)
Print report direct to ODT file by filePath. Second param open indicates open or not after printing a pdf file.
Warning: This function Under construction!
See also printExec(), printHTML(), and printPDF().
void QtRPT::printPDF(const QString & filePath, bool open = true)
Print report direct to PDF file by filePath. Second param open indicates open or not after printing a pdf file.
See also printExec(), printHTML(), and printODT().
[slot]
void QtRPT::printPreview(QPrinter * printer)
Starts print or draw report at printer. Commonly, the purpose of this slot is using with QPrintPreviewWidget
Example:
QPrinter *printer = new QPrinter;
printer->setOutputFormat(QPrinter::PdfFormat);
printer->setOrientation(QPrinter::Portrait);
printer->setPaperSize(QPrinter::A4);
printer->setFullPage(true);
QPrintPreviewWidget *preview = new QPrintPreviewWidget(printer, this);
connect(preview, SIGNAL(paintRequested(QPrinter*)), report, SLOT(printPreview(QPrinter*)));
void QtRPT::setBackgroundImage(QPixmap & image)
Sets background image from image
void QtRPT::setBackgroundImage(QPixmap image)
This is an overloaded function.
Sets background image from image
[signal]
void QtRPT::setField(
RptFieldObject & fieldObject)
This signal is emitted when QtRPT request a Field's data from user application. Pass fieldObject to user's application as a reference to requested RptFieldObject. User should set the appropriate properties of the fieldObject. This signal is emitted before following signals: setValue, setValueImage, setValueDiagram
See also setValue(), setValueImage(), setValueDiagram(), and RptFieldObject.
bool QtRPT::setPainter(QPainter * painter)
Set the painter that will be used for the report to draw. Returns true
if assignment is success
bool QtRPT::setPrinter(QPrinter * printer)
Set the printer that will be used for the report to printing. Returns true
if assignment is success
void QtRPT::setResolution(QPrinter::PrinterMode resolution)
Sets resolution of the printer
void QtRPT::setSqlQuery(QString sqlString)
Sets SQL query sqlString. If in XML was defiened SQL query, it will be replaced.
[signal]
void QtRPT::setValue(const int recNo, const QString paramName, QVariant & paramValue, const int reportPage)
This signal is emitted when QtRPT request a Field's data from user application. And pass to the user's application the following variables
- recNo - record number (if field placed on DataBand)
- paramName - name of requested field
- reportPage - number of the report
From user's applications, QtRPT expects the data in the variable paramValue, which acts as a references
- paramValue - data, which will processed by QtRPT and printed
This signal is emitted after following signal: setField()
See also setField(), setValueImage(), and setValueDiagram().
[signal]
void QtRPT::setValueDiagram(Chart & chart)
This signal is emitted when QtRPT request a Chart's data from user application. Pass chart to user's application as a reference to requested Chart object. User should set the appropriate properties of the chart. This signal is emitted after following signal: setField()
See also setField(), setValue(), and setValueImage().
[signal]
void QtRPT::setValueImage(const int recNo, const QString paramName, QImage & paramValue, const int reportPage)
This signal is emitted when QtRPT request a Field's data from user application. And pass to the user's application the following variables
- recNo - record number (if field placed on DataBand)
- paramName - name of requested field
- reportPage - number of the report
From user's applications, QtRPT expects the QImage in the variable paramValue, which acts as a references
- paramValue - QImage, which will processed by QtRPT and printed
This signal is emitted after following signal: setField()
See also setField(), setValue(), and setValueDiagram().