An OpenCReports XML description may consists of multiple
separate reports. This is achieved by so called
"report parts". Such a <Part>
may be
under the toplevel <OpenCReport>
node, in which case multiple report parts may exist
in the same XML. It may also be the toplevel node of
the XML. In the latter case, only a single
<Part>
may be present in
the XML description.
<Part> <pr> <pd> <Report> ... </Report> ... </pd> ... </pr> ... </Part>
A report <Part>
may consist
multiple reports, arranged in
rows (<pr>
),
columns in rows (<pd>
), and
reports (<Report>
) arranged
vertically in a column.
The rows and columns in rows do not form a grid as rows are independent of each other. E.g. one row may contain two columns, the next one may contain three, the next one may contain one. It is completely freeform.
This allows very complex report layouts. One possible application of such a complex layout is printed forms.
Note that any attribute setting below may only use constant expressions or an query column reference from Independent queries. An environment variable (since it can't - or shouldn't - change during the report execution) is considered constant. See Expressions. This allows external control for the attributes in question.
The font name attribute specifies the font for the report part's global scope. It can be overridden by child nodes for their scope. It may be specified in two forms, the first one is the preferred name, the second is for RLIB compatibility:
<Part font_name="'Arial'"> <Part fontName="'Arial'">
If both forms are specified, font_name
is used.
Default font name is Courier
.
The font size attribute specifies the font size for the report part's global scope. It can be overridden by child nodes for their scope. It may be specified in two forms, the first one is the preferred name, the second is for RLIB compatibility:
<Part font_size="10"> <Part fontSize="10">
If both forms are specified, font_size
is used.
Default font size is 12.
Shortcut for the Size unit attribute in
<OpenCReport>
when
<Part>
is the toplevel node.
<Part size_unit="'rlib'"> <Part size_unit="'points'">
When <OpenCReport>
is the
toplevel node in the XML, this attribute for
<Part>
is ignored.
Shortcut for No query show NoData attribute in
<OpenCReport>
when
<Part>
is the toplevel node.
<Part noquery_show_nodata="yes"> <Part noquery_show_nodata="no">
See default in No query show NoData attribute See also NoData node.
Shortcut for Report height after last attribute in
<OpenCReport>
when
<Part>
is the toplevel node.
<Part report_height_after_last="yes"> <Part report_height_after_last="no">
See default in Report height after last attribute See also NoData node.
Page orientation for the whole
<Part>
.
<Part orientation="'portrait'"> <Part orientation="'landscape'">
Default is portrait orientation.
Margin settings for the page for the whole
<Part>
. Individual
settings exist for the top, bottom, left and
right margins of the page. Every setting
exist in two forms: the RLIB compatible
"lowerCamelCase" variant and the all lowercase
with underscore. The latter variants are preferred.
<Part top_margin="0.2"> <Part topMargin="0.2"> <Part bottom_margin="0.2"> <Part bottomMargin="0.2"> <Part left_margin="0.2"> <Part leftMargin="0.2"> <Part right_margin="0.2"> <Part rightMargin="0.2">
When size_unit="'rlib'"
is in effect
(the default case) the margin unit is inches.
The margin unit is points (1/72th inches) when
size_unit="'points'"
is in effect.
Default values for the top, bottom, left and right margins are all 0.2, regardless of the unit.
Note that rightMargin
didn't exist
in RLIB.
Paper type (implicitly: page size) for the whole
<Part>
. It exists in
two forms: the RLIB compatible "lowerCamelCase"
variant and the all lowercase with underscore.
The latter variant is preferred.
<Part paper_type="'A4'"> <Part paperType="'A4'">
Default value is the current system paper type
that libpaper
uses. E.g. if the system is set to US English,
the default paper type is implicitly
letter
. In most of Europe,
the default paper type is A4
The paper type can be specified in either lower case or upper case, both are accepted.
The same <Part>
may be
executed multiple times.
<Part iterations="3">
Default value is 1.
Note that a <Part>
and
every iteration of it start on a new page.
This is one way to print multiple copies
of a report and encode it into the output,
e.g. in the PDF file.
Report parts may be suppressed.
<Part suppress="yes">
Default value is false
,
i.e. no suppression.
The <PageHeader>
section
(see Page header below)
for <Part>
may be
suppressed on the first page.
<Part suppressPageHeaderFirstPage="yes">
Default value is no
.
Note that this suppression applies only to the first page of the complete result (e.g. PDF) and not to the first page of an iteration, which may fall on a later page of the result.
As described at the beginning of this section
(see Report parts), a
<Part>
may contain
one or more report rows (<pr>
)
which in turn may contain one or more columns
(<pr>
). See
Part row and Part column.
Apart from these, global page headers and footers
may also be used for report parts.
This is the description of the page header. It contains an Output node. The expressions in it cannot reference query columns. See also Report page header.
<Part> <PageHeader> <Output> ... </Output> </PageHeader> </Part>
This is the description of the page footer. It contains an Output node. The expressions in it cannot reference query columns. See also Report page footer.
<Part> <PageFooter> <Output> ... </Output> </PageFooter> </Part>