DATA DEPENDENT LINE SPACING IN DATA BASE REPORTS PROBLEM There are frequently circumstances in the generation of Data Base Reports under Symphony where it would be useful to have an extra line feed inserted depending upon the data content of the previous or next record in the report. Examples: When printing a mailing list or phone list in alphabetic order, the report will be more legible if there is an extra line-feed separating the A's from the B's, and so on. When printing data from a chart of accounts, to be able to feed a line when the master account number changes. Although one might use the Symphony "Multiple" report format to do this, this can be cumbersome to set up, and forces printing of the "Above Range" with each section of the report. Symphony allows you to imbed control codes in the report range using the special label prefix "|", but unfortunately, the control codes following the "|" must be fixed and not computed. Moreover, Symphony sends to the printer ONLY the contents of the "|" label on that line. SOLUTION There is a solution IF your printer permits or uses "Escape" code sequences to cause line feeds or to affect the size of line feeds. An "Escape" code sequence is one in which a particular control code (ASCII 0 to 31) causes the printer to interpret the following characters as a command line rather than as data to be printed. The most common character to initiate this is \027 (Escape), but might be any other that the printer manufacturer chooses. For example, the IDS Prism printer allows one to use an escape sequence to program the line separation that occurs with an ordinary line feed. In order to establish a line spacing of nn/48 inches, one sends to the printer the following sequence: \027,B,nn,$ Thus the sequence \027,B,8,$ sets normal (6 lines per inch) spacing, while \027,B,0,$ causes no paper advance with the normal line feed. EXAMPLE In order to take advantage of this under Symphony, consider the following example. You have a data base consisteing of two fields, "Name" and "Address", and wish to print the alphabetic listing skipping lines whenever the first letter of the name changes. In the "Main" range of the Report, use the following four lines: |\027,B, @IF(@LEFT(+NAME,1)<>@LEFT(+A25),"8,$","0,$") |\027,B,8,$ +NAME Here, the first and third lines are Labels with the special prefix "|". (Enter these by typing ||\027, etc.). The second line is a formula that compares tests the first character of the NAME with the entry preceding it. (In the example, the cell address of NAME would be A26.) The effect of this sequence is to single space the list of names except where the lead letter changes. There, an extra line is inserted. The sequence works as follows: Symphony sends only the special label contents for the first line. This initiates the escape sequence to the printer. The second line is transmitted in its entirety. Because Symphony interprets this as a simple string to print, it will terminate this line with a carriage return/line feed. The printer will interpret the string value of the @IF as the new spacing (Normal or Zero) and will space to the next line accordingly when it receives the line feed. The third line is only an escape sequence (no characters or line feed will be sent by Symphony). The sequence will assure that the printer has returned to normal spacing when it prints the fourth line. Finally, the fourth line is the normal Report line. If line two evaluated to "0,$" then this is the only line of the sequence which will cause the paper to advance in the printer. NOTES Although this technique is discussed in the context of line spacing, it can be used to cause data dependent selection of any of the printers special features that are invoked by escape codes. For instance, with many printers it would be possible to cause a data dependent change in the font, say to print the bulk of a report in draft mode, but to switch to Near Letter Quality for the first line in a block. Woody Beeler 76044,351