12.07.2015 Views

Using Zen Reports - InterSystems Documentation

Using Zen Reports - InterSystems Documentation

Using Zen Reports - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• When a or contains a query with parameters and its parent is a sibling, theparameters refer to the values they have in the parent, which are the values they had in the firstsibling in that parent’s group, before that first sibling encountered a break.• When a group is a nested group, it gets a row of data for each row in its parent group, regardlessof whether that row meets any break condition. That is, a parent group gives all its data to eachof its child groups, whether or not a break condition has been met.• A sibling group only gets data after a break condition has been met, and uses the data that existedin the row just before the break condition was met.• If the siblings within a group contain elements, <strong>Zen</strong> correctly recognizes aggregateson any sibling in the group. The sibling does not need to be the first sibling in the group.3.6.3 Break On Field or ExpressionThe or can organize its resultset by providing breakOnExpression and breakOnFieldattributes. These attributes tell the or how to organize the records that it has retrievedfrom the resultset. To “break on” an item means to “group the records in the resultset according tothe value of” this item. An example would be to list sales by month, graduates by fraternity house,and so on. If no “break on” item is supplied, the processes every record in the resultset inthe same way, without breaking or grouping the records.The “break on” item is either:• A field in the resultset. Use the breakOnField attribute to identify this field using its name in thequery that controls the group. The group then organizes its records according to the value of thisfield;or:• An expression that calculates a value based on a field in the resultset. Use the breakOnExpressionattribute to specify this expression. If you use breakOnExpression, you must also supply abreakOnField to identify the field whose value is the input argument for that expression. Withinthe breakOnExpression, use the keyword %val to represents this field’s value. The group thenorganizes its records according to the value calculated by the expression.For example, suppose you want to group by month, and you have a method in the <strong>Zen</strong> report classcalled GetMonth which accepts a date as an input argument and returns a value indicating the month.Then you could set breakOnField to the resultset field that contains the date, and use breakOnExpressionto calculate the month that you want to use to group the records, like this:<strong>Using</strong> <strong>Zen</strong> <strong>Reports</strong> 33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!