8.6. Report parts #

8.6.1. Part attributes
8.6.2. Part subsections

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

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.

8.6.1. Part attributes #

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.

8.6.1.1. Font name #

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.

8.6.1.2. Font size #

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.

8.6.1.3. Size unit #

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.

8.6.1.4. No query show NoData attribute #

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.

8.6.1.5. Report height after last attribute #

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.

8.6.1.6. Orientation #

Page orientation for the whole <Part>.

<Part orientation="'portrait'">
<Part orientation="'landscape'">

Default is portrait orientation.

8.6.1.7. Margin settings #

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.

8.6.1.8. Paper type #

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.

8.6.1.9. Iterations #

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.

8.6.1.10. Suppress #

Report parts may be suppressed.

<Part suppress="yes">

Default value is false, i.e. no suppression.

8.6.1.11. Suppress page header on the first page #

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.

8.6.2. Part subsections #

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.

8.6.2.3. Part row #

See Part row.

<Part>
    <pr>
        <pd>
            ...
        </pd>
    </pr>
</Part>