Documentation Breaks Variables
From RLIB
Breaks
Breaks provide a method to accumulate the total of a variable (or variables) and print them out. Breaks may be used to tally a "hierarchy" of data. Generic documentation is under <Breaks> in the Report XML Definition. Breaks have the following form:
<Breaks>
<Break name="break0" newpage="no" headernewpage="yes" suppressblank="yes">
<BreakFields>
<BreakField value="var_name" />
</BreakFields>
<BreakHeader>
<Output>
.
.
.
</Output>
</BreakHeader>
<BreakFooter>
<Output>
.
.
.
</Output>
</BreakFooter>
</Break>
</Breaks>
<Breaks> begin and end tags define the start and end of the Break Section. All <Break> tags belong between these tags.
<Break> tag starts the break, and allows the following attributes:
- name - A name for the break. Using this name, variable may be reset when this break occurs.
- newpage - If yes, a new page will be created when this break occurs.
- headernewpage - If yes, when a new page occurs, header will be written to this page.
- suppressblank - If yes, nothing will be written if the <BreakField> value is NULL or BLANK.
The <BreakFields> tag has no attributes, and contains a single <Breakfield> tag.
The <BreakField> tag defines which data will trigger the break when the data value changes. The data may be a field from the query or values created in the variables section.
The <BreakHeader> tag will cause a print out of data before the <Detail> section. The data will be defined within an <Output> section within this section.
The <BreakFooter> tag will cause a print out of data after the <Detail> section.
NOTES:
- The order in which the <BreakField> name attribute occurs in the data set is important.
- The <BreakHeader> and <BreakFooter> tags are optional.
- Breaks may be used to reset counter variables.
The following is an example:
dataset = Var1 Var2
a 1
a 2
a 3
b 4
b 5
b 6
Report Variables are are expressions RLIB evaulates for every detail line, and resets automatically if asked to on breaks. Report variables are useful things like COUNT, SUM, AVG, HIGHEST, LOWEST. You may also use report variables to simplify expressions that will be used (normally more than once) in other calculations. To do this use the type EXPRESSION. A report variable can be "RESET" on the event of a BREAK (this does not apply to EXPRESSION).
Examples:
<Variable name="customer_count" value="val(ei_count)+val(to_count)+val(dt_count)" type="expression"/> <Variable name="daily_percent" value="v.daily_diff / v.this_year_netsales * 100" type="expression"/> <Variable name="this_year_mtd" value="v.this_year_netsales" type="sum" resetonbreak="break5"/> <Variable name="last_year_mtd" value="v.last_year_netsales" type="sum" resetonbreak="break5"/> <Variable name="monthly_diff" value="v.this_year_mtd - v.last_year_mtd" type="expression"/> <Variable name="monthly_percent" value="v.monthly_diff / v.this_year_mtd * 100" type="expression"/>
