• No results found

Reading Order

In document VFP Report Writer (Page 139-142)

directly on top of the other object, making sure they are aligned perfectly with each other.

When the report prints, either the red dollar amount prints or the black dollar amount prints, but not both of them.

Text Alignment

Text Alignment controls how the text within a Label object or Field object is aligned within the defined width of the object. Select the object you wish to alter. Then select Format | Text Alignment | <your choice> from the main VFP Menu bar. The three options are:

• Left: This option positions the text flush with the left edge of the object.

• Center: This option centers the text within the object.

• Right: This option positions the text flush with the right edge of the object.

At first thought, you may be wondering why in the world you would need to use Text Alignment on a Label object. After all, the object is only as wide as the text. Well, I’ve learned over the years that what you see is not always what you get. The visual representation of the label on the screen doesn’t always match what is printed on the report. For example, let’s say I want a label lined up flush with the right edge of a numeric field. I could use the Align Left Sides option from the Layout toolbar to make sure the Label object is flush with the left edge of my Field object. However, this might not work as expected.

The reason it doesn’t always work is that the fonts displayed on the screen are not always TrueType fonts and can’t always be accurately displayed. In these situations, a close match is used to display the font. It’s possible that the close match isn’t quite the same width as the real font that is used when the report is printed. This means that my right-aligned label looks great on the screen, but prints a slightly different width on the report and isn’t flush like I expected.

The point to this explanation is to use Text Alignment on your Label objects as well as your Field objects to ensure that what you see on the screen is also what you see on the printed report.

You may have noticed that there are three additional options on the Text Alignment submenu that I haven’t discussed: Single Space, 1 1/2 Space, and Double Space. The reason I didn’t discuss them is because you can’t select them. I’m guessing that these options are intended to let you select the spacing of Field objects that span multiple lines. Unfortunately, they’re not implemented and they just sit there and tease us!

Reading Order

Unless you’re running a Middle Eastern version of Microsoft Windows, this option is not enabled. It’s used to control whether the text is displayed in left-to-right order or right-to-left order.

In FoxPro 2.x, you cannot change the Reading Order.

Fill

The Fill option is used to control what pattern is used to fill the inside of shapes, such as Rectangles and Rounded Rectangles. Select the object you want to fill and then select Format | Fill from the main VFP Menu bar. This displays the submenu shown in Figure 8. The first item on this submenu fills the object with nothing. So no matter what color you’ve chosen as a background color, nothing ever appears. The second item on the submenu fills the object solid with the background color.

Figure 8. Use the fill options to control what pattern is used to fill the inside of a Rectangle or Rounded Rectangle object.

The last six options on the Fill submenu fill the object with the chosen pattern, using the background color to draw the lines of the pattern. Keep in mind, however, that the foreground color of the object is still used to draw the border around the object.

Although you cannot control the color of the white space between the pattern lines, here’s a trick to get around that. Draw two rectangles of the same size on the report. For the first rectangle use a solid fill, choosing the color you want as the white space. Then, on the second rectangle, set the fill pattern of your choice using the background color of your choice to draw the lines. Be sure to set the second rectangle (the one with the patterned fill) as Transparent (see the section titled “Mode” later in this chapter) so the solid-filled rectangle can bleed through the pattern-filled rectangle.

Pen

The Pen option is used to control what style of line is used when drawing lines and the border of rectangles and rounded rectangles. Select the object you want to affect, and then select Format | Pen from the main VFP Menu bar. This displays the Pen submenu shown in Figure 9.

Select any one of the 10 different Pen options from the Pen submenu. A sample of the different options is shown in Figure 10. The None option tells the VFP Report Writer to suppress the border around Rectangle and Rounded Rectangle objects. For Line objects, the None option creates an invisible line (which is sometimes necessary to force the VFP Report Writer to do what you want).

Figure 9. Use the Pen submenu to select the type of line used to draw lines, rectangles, and rounded rectangles.

Figure 10. These 10 different Pen options control how lines are drawn as well as the border around rectangles and rounded rectangles.

Mode

The Mode controls whether the object is transparent or opaque. Transparent means that it’s see-thru and objects underneath it can bleed through. Opaque means that the object is solid and nothing underneath it bleeds through. In other words, this object completely covers and overpowers any objects underneath it.

To change the Mode of an object, select the object. Then select Format | Mode | <your choice> from the main VFP Menu bar.

In document VFP Report Writer (Page 139-142)