Progress
Report Builder
User’s Guide
Eliminating Blank Spaces Between Fields
By default, Report Builder prints or displays a field in the position where you inserted it on the layout. However, you can choose to remove blank spaces between fields. Report Builder trims any trailing spaces stored at the end of the first field value in the database, and prints the second field immediately following the first field, regardless of its position on the report layout.
The ability to trim blank spaces allows you to eliminate space between fields whose data varies in width. For example, you can print data from State and Postal-Code fields on the same line with no space between them.
Follow these steps to print two fields without intervening space:
When you print or display the report, the fields have no space between them, even if they are separated by an empty area on the report layout.
You can include a single space between fields by inserting a text string consisting of one space and setting the merge left option for that field to Print at End of Previous Field. You can also insert a text string consisting of a comma and a space between the City and State fields to print the data in the appropriate format for addresses.
NOTE: You cannot use the merge left option with word-wrapped fields.The ability to merge fields allows you to place fields on the report layout so that they will not be separated by blank spaces. For example, by default, PAGE 2 on a report layout prints as:
PAGE: 2
However, if you specify Print at End of Previous Field as the Merge Left setting, PAGE 2 prints as:
PAGE: 2
Notice that there is a space between the “Page: ” and “2". This occurs because the “Page: ” text field includes a space at the end of the string.
Also, when the merge left setting is Print at End of Previous Field, First-Name and Last-Name fields on a line print without space between them. For example, by default xxxxxxxxxxxx xxxxxxxxxx prints as:
Todd Winmill
If you specify Print at End of Previous Field for the Last-Name field, the name prints as:
ToddWinmill
To print the full name with a single space between the first and last name, you must insert a text string that consists of one space between the First-Name and Last-Name fields.
Merge Left and Field Alignment
When you merge fields to the left, you must consider field alignment. Report Builder assigns every field on the layout a default alignment when you insert the field on the report layout. As described in the previous section, the alignment options are left-aligned, centered, or right-aligned. When you apply Merge Left to multiple fields, Report Builder considers these fields as a single field for the purpose of field alignment and assigns the series the alignment of the first field in the group.
For example, if you want the page number to appear in the upper-right corner of the page as “Page: 1", you must place a “Page: ” text field and a page number calculated field on the first page header band line. If you place the right edge of the page number field at the right margin and the “Page: ” text field an inch to the left of the page number, Report Builder prints the following:
Page: 1
To eliminate the blank spaces between the fields, you can specify to merge all the fields on the page header line to the left. However, because these two fields are different data types, you must consider each field’s alignment. By default, a text field is left-aligned, and a numeric field is right-aligned. Therefore, when you specify to merge all the fields on the page header band line containing these two fields, Report Builder left-aligns both fields because the first field,
“Page: ”, is left-aligned. This means that Report Builder not only eliminates the spaces between the two fields, but also displays the fields at the position of the “Page: ” text field as follows:
Page: 1
This is not the result you want. To merge the page number field to the left and still print the page number at the right margin, you must change the alignment of the “Page: ” text field from left-aligned to right-aligned. When you change the text field’s alignment, Report Builder then right aligns both fields as follows:
Page: 1
A specific instance when field alignment affects how Report Builder implements the Merge Left option is when the first field in a series of fields has an alignment of centered. If you have a series of fields on a record band line and the first field is centered, Report Builder centers all the fields within the fields’ collective width. For example, if you have a centered “Customer: ” text field, customer name character field, “Number: ” text field, and a customer number character field on the band line, Report Builder displays the following output:
Customer: Chip’s Poker Number: 37
When you apply Merge Left to all the fields on a band line, Report Builder centers the fields within the collective width of all the fields. You calculate the fields’ collective width by adding all the characters allocated in the fields’ formats. The total number of characters allocated in these fields’ formats is 45 characters. Therefore, Report Builder centers the 34 characters of data within the collective width of all four fields, which is 45 characters, and displays the following output:
Customer: Chip’s Poker Number: 37
The fields appear off-center on the report. To center the fields between the page margins, use the justify band line function to center the fields. Then Report Builder displays the following:
Customer: Chip’s Poker Number: 37
If you specify to merge left for multiple fields, be aware of the alignment of the first field because it affects how Report Builder displays the fields.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |