Aligning and Formatting Controls and Adjusting Line Spacing

The exact alignment of label and text box controls is more important on reports than it is on forms because in the printed report any misalignment is obvious. Formatting the controls further improves the report's appearance and readability.

The spacing of the report's rows in the Detail section is controlled by the section's depth. Likewise, you can control the whitespace above and below the headers and footers by adjusting the depth of their sections and the vertical position of the controls within the sections. To create a professional-looking report, you must adjust the controls' alignment and formatting as well as the sections' line spacing.

Aligning Controls Horizontally and Vertically

You align controls by first selecting the rows to align and then aligning the columns. Access provides several control-sizing and alignment options to make the process easier. To size and align the controls that you created, follow these steps:

  1. graphics/close.gif If you still have the Inventory by Category report in Print Preview, click the Close button to return to Design view.

  2. You can simultaneously adjust the height of all text boxes to fit the font used for their contents. Press Ctrl+A or choose Edit, Select All to select all the controls in the report.

  3. Choose Format, Size, To Fit to adjust the height of the selected controls. Access adjusts all the controls to the proper height. To deselect all the controls, click a blank area of the report.

  4. Select all labels in the Page Header sections. Choose Format, Align, Top. This process aligns the tops of each selected label with the uppermost selected label. Click a blank area of the report to deselect the labels.

  5. Select all text boxes in the Detail section and repeat step 4 for the text boxes.

  6. Select the labels and text boxes in the CategoryID Footer and Report Footer sections and repeat step 4.

  7. graphics/align_right.gif Select all controls in the Units column. Choose Format, Align, Right so that Access aligns the column to the right edge of the text farthest to the right of the column. Then click the Align Right button on the toolbar to right-align the contents of the labels and text boxes. (The first part of this step aligns the controls themselves to the rightmost control, and the second part right-aligns the text or data displayed by the selected controls.)

  8. Select all controls in the Cost column and repeat step 7.

  9. Select all controls in the Values column (except the Page Footer text box) and repeat step 7.

  10. graphics/preview.gif Click Print Preview to display the report with the improved alignment of rows and columns.

Formatting Controls

As shown previously in Figure 16.22, you must revise the formatting of several controls. In particular, the default General Number format for Cost and Value fields results in a varying number of digits after the decimal point. Cost and Value fields should be formatted with thousands separators, and category and grand totals need currency symbols to conform to North American standard accounting practices.

To change the Format property of these fields, follow these steps:

  1. graphics/close.gif Click the Print Preview toolbar's Close button to return to Design view.

  2. Double-click the Detail section's Cost text box to open its Properties window, and then click the Format tab of the Properties window.

  3. In the Format text box, select Standard. This format specifies two decimal places and adds thousands separators without a currency symbol.

  4. Select the Values text box and repeat step 3. The Detail section doesn't require dollar signs.

  5. Select each of the three text boxes in the units column, and type #,##0 as the value of the Format property to add thousands separators to these fields.

  6. Select the txtCatValue in the CategoryID Footer. Click the Properties window's Format tab and type $#,##0.00 in the Format field. Accountants use dollar signs to identify subtotals and totals in ledgers.

    Tip

    If you select Currency formatting instead of typing $#,#00.00 to add a dollar sign to the value, your totals don't align. Currency formatting offsets the number to the left to provide space for the parentheses that accountants use to specify negative monetary values.

  7. Select the txtTotalValue text box in the Report Footer and repeat step 6 for the grand total values.

  8. graphics/font_size.gif graphics/underline.gif The grand total values in the Report Footer are the report's most important element, so increase the font size to 9 points, and apply the underline attribute to the text box.

  9. graphics/last_record.gif Click the toolbar's Print Preview button to check your formatting modifications. Click the Bottom of Report page selector button to display the last page of the report (see Figure 16.24).

    Figure 16.24. Right-aligning and applying appropriate formats to numeric values gives your report a professional appearance.

    graphics/16fig24.gif

You might need to increase the width of the text boxes to accommodate the added thousands separators and, where applicable, the currency symbol.

Adjusting Line Spacing

In the Page Header section, the controls are placed further apart than is necessary, and the depth of the controls in the Report Header section is out of proportion with the size of the text. The line spacing of the remainder of the report's sections is satisfactory, but you can also change this spacing. Minimizing line spacing allows you to print a report on fewer sheets of paper.

Tip

You might have to return to Design view and adjust the width or position of the Cat(egory) and Grand Totals text boxes to align these values with those for the individual products.


To change the spacing of the report's Page Header and Detail sections, follow these steps:

  1. graphics/close.gif Click Print Preview's Close button to return to Design view.

  2. Select all the labels in the Page Header and move the group to the top of the section.

  3. Click the bottom line of the Page Header and move the line to the bottom of the text boxes. (To select the line, you might need to move the CategoryID Header section downward temporarily.)

  4. Click a blank area of the report and then move the CategoryID Header section to two grid dots below the line.

  5. Drag the CategoryID Footer section up to the bottom of the Detail section's text boxes.

  6. Click the toolbar's Report View button to check the Page Header depth and line spacing of the Detail section. The spacing shown in Figure 16.25 is close to the minimum that you can achieve. You can't reduce a section's line spacing to less than that required by the tallest text box or label by reducing the section's Height property in the Properties box. If you try this approach, Access rejects the entry and substitutes the prior value.

    Figure 16.25. The report shows the effect of adjusting the depth of the Report Header, Page Header, and Detail sections.

    graphics/16fig25.jpg

  7. graphics/view_zoom.gif Click the Zoom button on the toolbar to display the report in full-page view. (Clicking the mouse when the pointer is the magnifying glass symbol has the same effect as clicking the Zoom button. Alternate clicks toggle between full-size and full-page views).

  8. Click Ctrl+S to save your changes.

graphics/power_tools.gif

The Inventory by Category report is included on the accompanying CD-ROM as Report16.mdb in the \Seua11\Chaptr16 folder.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net