QTIPS - BREAK-ON Headings
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Sprezzatura Ltd | 01 MAY 1992 | 2.12+ | EXPERT | BREAK-ON, RLIST |
David Edkins of D.E. Associates writes, "Further to the Break-On discussion, I wonder how many of your subscribers are aware that the Break-on options 'B' coupled with the Heading option 'B' gives the developer complete control over the Heading and Footing blocks in R/List reports."
For example, this technique can be used to provide headings and footings that:
- include the contents of more than one Break-on field!
- include application specific details (e.g. company name)
- include user specific details (e.g. User name)
- include report specific details (e.g. selection parameters - perhaps set up in labelled common via a collector window.
- include printer formatting sequences
My preferred approach is as follows:
- Add the clause BREAK-ON BREAK "'B'" to any R/LIST report.
- Also add the clause HEADING "'B'" to the R/LIST report.
- Define a dictionary BREAK (possibly on VOC) that creates the appropriate HEADING block. This can include any number of linefeeds (just include CHAR(13) : CHAR(10) in the string). The block must be returned in @ANS.
Editor's note - As an example of this simple but effective technique it might be instructive to try the following. Create a dictionary item on the DICT of VOC called BREAK and include the formula
Equ CRLF$ To Char(13) : Char(10) @Ans = "Type = ":@Record<1>:" - File = ":@Record<3> @Ans := CRLF$ : "Demonstration Heading" : CRLF$
and then run the TCL statement
:LIST VOC BY F1 BREAK-ON F1 "'P'" JUSTLEN "L0" BY F3 BREAK-ON F3 "'P'" JUSTLEN "L0" F4 JUSTLEN "L30" BREAK-ON BREAK "'B'" HEADING "Test of break on'LBL'"
(Volume 4, Issue 1, Page 5)