The report is a static global object which exists only while processing a BPS report.
More...
The report is a static global object which exists only while processing a BPS report.
There is only one static report object, you can not create new objects of this type.
A report definition is represented by three layers of elements:
- The top level is the report object.
- The middle layer (children of report) is a list of sections.
- The bottom level (children of sections) is a list of items.
Property Matrix:
Not all property types are currently accessible by scripting, however what will work by now are BpsDatastore and simple types such as QString, bool, int, qreal and enums such as BarcodeType, Direction, Orientation, Papersize, Rotation etc.
Name | Type (C++ type, remarks) | Report | section | simpletext | richtext | line | rectangle | ellipse | barcode | pixmap |
alignment | bps.Alignment (Bps::Alignment) | no | no | yes | no | no | no | no | no | yes |
application [1] | String (QString) | yes | no | no | no | no | no | no | no | no |
autogrow | Boolean (bool) | no | yes | no | no | no | no | no | no | no |
barcodetype | bps.Barcode (Bps::Barcode) | no | no | no | no | no | no | no | yes | no |
brush | bps.Brush (QBrush) | no | no | yes | yes | no | yes | yes | no | no |
color | bps.Color (QColor) | no | no | yes | yes | no | no | no | yes | no |
data [1] | Application dependent a simple value, an object or an array | yes | no | no | no | no | no | no | no | no |
datastore [1] | bps.Datastore (BpsDatastore) | yes | no | no | no | no | no | no | no | no |
direction | bps.Direction (Bps::Direction) | no | no | yes | yes | no | no | no | yes | no |
emptyok | Boolean (bool) | yes | no | no | no | no | no | no | no | no |
font | bps.Font (QFont) | no | no | yes | yes | no | no | no | yes | no |
height | Number (qreal, mm) | no | yes | no | no | no | no | no | no | no |
margins | bps.Margins (BpsMargins, mm) | yes | no | yes | yes | no | no | no | no | no |
module | Number (qreal, mm) | no | no | no | no | no | no | no | yes | no |
name | String (QString) | yes | yes | yes | yes | yes | yes | yes | yes | yes |
orientation | bps.PaperOrientation (QPrinter::Orientation) | yes | no | no | no | no | no | no | no | no |
p1 | bps.Point (QPointF, mm) | no | no | no | no | yes | no | no | no | no |
p2 | bps.Point (QPointF, mm) | no | no | no | no | yes | no | no | no | no |
paper | Number (QPrinter::Papersize) | yes | no | no | no | no | no | no | no | no |
papersize | bps.Size (QSizeF, mm) | yes | no | no | no | no | no | no | no | no |
pen | bps.Pen (QPen) | no | no | yes | yes | yes | yes | yes | no | no |
pixmap | bps.Pixmap (QPixmap) | no | no | no | no | no | no | no | no | yes |
pos | bps.Point (QPointF, mm) | no | no | yes | yes | no | yes | yes | yes | yes |
position | bps.VerticalAlignment (Bps::VerticalAlignment) | no | yes | no | no | no | no | no | no | no |
ppi | Number (int, points per inch) | no | no | no | no | no | no | no | no | yes |
rawcodec [2] | String (QString) | yes | no | no | no | no | no | no | no | no |
rawdata [2] | String (QString) | yes | no | no | no | no | no | no | no | no |
rotation | bps.Rotation (Bps::Rotation) | no | no | no | no | no | no | no | no | yes |
rounded | Boolean (bool) | no | no | no | no | yes | no | no | no | no |
roundness | Number (int, 0...100%) | no | no | yes | yes | no | yes | no | no | no |
script | String (QString) | yes | no | no | no | no | no | no | no | no |
selections [1] | Object (QMap<QString,QVariantList>) | yes | no | no | no | no | no | no | no | no |
sid [1] | String (QString) | yes | no | no | no | no | no | no | no | no |
size | bps.Size (QSizeF) | no | no | yes | no | no | yes | yes | yes | yes |
sizing | bps.PixmapSizing (BpsGraphicsPixmapItem::Sizing) | no | no | no | no | no | no | no | no | yes |
spanAngle | Number (qreal, degree) | no | no | no | no | no | no | yes | no | no |
startAngle | Number (qreal, degree) | no | no | no | no | no | no | yes | no | no |
text | String (QString) | no | no | yes | yes | no | no | no | yes | no |
textprinted | Boolean (bool) | no | no | no | no | no | no | no | yes | no |
title [1] | String (QString) | yes | no | no | no | no | no | no | no | no |
width | Number (qreal, mm) | no | no | no | yes | no | no | no | no | no |
zvalue | Number (int) | no | no | yes | yes | yes | yes | yes | yes | yes |
[1] Dynamically applied at runtime before executing the report script:
- Application is a unique name per application such as "designer", "articles", "partners" or "ordertrips" for example.
- Title is taken from the current report settings (t_reportsettings.c_title). In the report designer it is the base filename instead.
- Selection is an object with each property name being a table name, and holding an array of keys of currenty selected rows.
- SID is unique per application and report setting, for example "ordertrips_57". It may be used as key to save and restore settings.
[2] Used to write directly to the printer, instead of preparing GDI content:
- Rawdata is the data to send to the printer.
- Rawcodec is the name of the codec used to encode the data. Default is ISO 8859-1 (Latin1). See QTextCodec for full list of available codecs. Example: "IBM 850".