Creating a Multiple-Column Report


Access reports come in two flavors: tabular, which uses a datasheet-like layout with fields in columns and records in rows; and columnar, which uses a form-like layout with the fields arranged in a single, vertical column for each record. For this reason, the columnar layout is also called the single-column layout.

The single-column format is useful when you have wide fields, because each field can use up to the entire width of the page. If your fields aren't all that wide, however, the columnar layout is wasteful because you end up with a great deal of whitespace to the right of the fields. The tabular layout can get rid of the whitespace, but it's not as nice looking as the columnar layout.

Instead of compromising, it's possible to get the efficiency of the tabular layout combined with the attractive look of the columnar layout. You can do this by creating a multiple-column report that takes the basic columnar format and bends the records so that they now snake through two or more columns. (This is sometimes called a snaked-column layout.)

Setting Up the Report

The multiple-column effect appears only when you preview or print the report. In other words, it's not something that you set up within the report Design window (that is, by manipulating the position of the fields and field labels). However, that doesn't mean that you can apply the multiple-column layout to any report. When you're building your report, bear in mind that the page is going to be divided into columns and that the width of each column is the width of the page divided by the number of columns, less the margins and the amount of space you want between each column.

For example, suppose you want two columns a half-inch apart on a page 8.5 inches wide. Assuming the left and right margins are one inch, that leaves six inches for the two columns, or three inches each. Therefore, when building the report, you need to make sure that no part of the report is wider than three inches. (Use the horizontal ruler to monitor the width of the report. If you don't see the ruler, choose the View, Ruler command.)

Finally, after your controls are set to the proper width, change the width of the report itself so that it's no wider than the column width you want.

Tweaking the Page Setup

You set up a report to use multiple columns by modifying the Page Setup options. Here are the steps to follow:

1.

Choose File, Page Setup to display the Page Setup dialog box.

2.

In the Margins tab, make note of the left and right margin widths, as given by the values in the Left and Right text boxes. You need these values to calculate the optimal column width.

3.

Display the Columns tab.

4.

In the Grid Settings group, use the Number Of Columns text box to enter how many columns you want to use in your report. As shown in Figure 4.34, when you enter a value greater than 1, Access enables the Column Layout group.

Figure 4.34. Use the Columns tab to set up your report to use multiple columns.


5.

If you want to include extra space between each record, add the spacing value (in inches) in the Row Spacing text box.

6.

Use the Column Spacing text box to specify the amount of space (in inches) to allow between each column.

7.

In the Column Size group, the Width text box should already be set to the width of your report (assuming the Same as Detail check box is activated). If not, use the Width text box to enter the width you want to use for each column. You can also use the Height text box to specify the height of each record.

8.

Use the Column Layout group to choose one of the following options:

Down, Then AcrossWith this option, the records are printed down each column, and the columns run across the page.

Across, Then DownIn this case, the records are printed across each row, and the rows run down the page.

9.

Click OK.

10.

Preview the report to make sure your columns look the way you want.

Cross-Reference

You can force Access to start a section at the beginning of a column (or row). For the details, see "Starting Sections at the Top of a Row or Column," later in this chapter.


Figure 4.35 shows a two-column report with data from the Northwind Customers table.

Figure 4.35. An example of a two-column report.


Troubleshooting Multiple Columns

If your columns don't all fit on the page, Access displays the dialog box shown in Figure 4.36.

Figure 4.36. Access displays this dialog box if your columns don't all fit the width of the page.


Here are some solutions to try:

  • Reduce the number of columns. For example, if three columns won't fit on the page, trying using only two.

  • Reduce the width of each column. In the Columns tab of the Page Setup dialog box, reduce the value of the Width text box in the Column Size group.

  • Reduce the width of your report by reducing the width of the controls and the report itself. If this prevents a field text box from displaying all its data, try increasing the height of the text box to compensate.

  • In the Margins tab of the Page Setup dialog box, reduce the Left and Right values accordingly. The smaller your margins, the more room Access can devote to the columns.

    Watch the Margin Size

    Most printers don't support margins much smaller than about 0.25 inches. Also, some older printers (such as the HP LaserJet Series II) don't support margins smaller than 0.5 inches.


  • In the Page tab of the Page Setup dialog box, choose Landscape instead of Portrait.



Tricks of the Microsoft Office Gurus
Tricks of the Microsoft Office Gurus
ISBN: 0789733692
EAN: 2147483647
Year: 2003
Pages: 129

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