Setting Print Options for Controls
The general layout and band position of your controls determine the time and place they are printed. You can also set specific print options for each control. Each control has a default size based either on its value (fields and labels) or the size you created (lines, rectangles, and pictures). The length of the control on the layout defines the display width of the control. Because the value of some controls will vary from record to record, you can set the height of the control to stretch downward to display the entire value. If you don't set it to stretch, the value will be truncated within the display width. You cannot resize Label controls, but you can resize all other controls.
Printing Controls with Variable-Length Values
If you want a control to use only the space needed by its value, you can set it to stretch. For example, the values in an expression can vary from record to record. Rather than allot a fixed amount of space on the report that accommodates the longest value, you can set the control to stretch downward to display the entire value. You can set controls below the stretching control to float down the page relative to the stretching control.
Examples of controls set to stretch and float
The stretch option is available for fields, vertical lines, rectangles, and rounded rectangles.
For an example of controls that stretch and float, see the report Wrapping.frx in the Visual FoxPro \Samples\Solution\Reports directory.
To set a field to stretch with its value
- Double-click the field control to display its dialog box.
- Select Stretch with overflow.
Controls that are placed relative to controls that stretch must be set to float or they will be overwritten.
To set a control to float
Double-click the control to display its dialog box.
In the control's dialog box, select Float.
Caution Some of your data could be overwritten during printing if: (1) you position a field relative to the bottom of the band and include below this field another field that is positioned relative to the top of the band and can stretch; or (2) you position a field relative to the top of the band and include above this field another field that is positioned relative to the top of the band and can stretch.
You can also set lines, rectangles, and rounded rectangles to stretch. They can stretch relative to the band or, if part of a group of controls, they can stretch relative to the largest control in the group.
To set a line or rectangle to stretch
- Double-click the control to display its dialog box.
- In the Stretch downwards area, select an option.
To print a border around a stretchable control
Draw a rectangle around the stretchable controls.
Double-click the rectangle to display the Rectangle/Line dialog box.
In the Stretch downwards area, select Stretch relative to the tallest object in group.
Choose OK.
Drag a selection box around the rectangle.
From the Format menu, choose Group.
Selection handles appear at the corners of the rectangle. From now on you can treat all of the controls as one. The rectangle will stretch along with the stretchable field. Regardless of how far down the value in the field stretches, the rectangle will maintain its border around the field. You can place two of these groups side by side in the layout and one will not be affected by the stretching of the other.
To print one stretchable control below another
- Insert the two controls one below the other in the layout.
- Double-click the top control to display the control's dialog box.
- In the Field Position area, select Fix relative to top band, and then choose OK.
- Double-click the bottom control to display the control's dialog box.
- In the Field Position area, select Float, and then choose OK.
The two record values will print in their entirety and will not overwrite each other.
See Also
Formatting Field Controls | Setting Each Control's Print Options | Adding Reports and Labels | SELECT - SQL