Using Report Manager: Printing Pivot Table Data

Một phần của tài liệu Excel PivotTables Recipe Book (Trang 255 - 260)

1. Right-click a cell in the pivot table, and choose Table Options.

2. Add a checkmark to Repeat item labels on each printed page.

3. Click OK to close the PivotTable Options dialog box.

Note This setting will have no effect if the table option for Merge Labels is turned on.

Notes

This setting can work in conjunction with the Set Print Titles pivot table option, described in Section 11.1. That setting ensures that the columns and rows that contain the headings appear on each printed page. The Repeat item labels on each printed page pivot table option ensures that labels print at the top of each page if an item runs on to two or more pages.

In Figure 11-6, both options are turned on, so headings and labels appear on each page.

11.8. Using Report Manager: Printing Pivot Table Data

Problem

Because of security settings, you can’t distribute a workbook that contains macros. You’d like to make it easy for users to print summary reports from the pivot table data.

Solution

Microsoft provides an Excel add-in, Report Manager, that you can use to create and print reports from worksheets, custom views, and scenarios. The download file and installation instructions are available on the Microsoft website “Excel 2002 Add-in: Report Manager,”

at www.microsoft.com/downloads/details.aspx?FamilyID=34dacd92-d511-4760-8094- 2754d82a4e2f.

Figure 11-6. The Category and Customer labels repeat at the top of page two.

1 1 . 8 ■ U S I N G R E P O RT M A N A G E R : P R I N T I N G P I V OT TA B L E D ATA 231

Figure 11-7. A GETPIVOTDATA formula extracts data from the pivot table.

Note Although the web page title specifies Excel 2002, the Report Manager download can be used in Excel 2003.

To create a summary table from the pivot table data, follow these steps:

1. On a blank worksheet, list the items that you want to summarize. In the example shown in Figure 11-7, items from the Status field are listed in B4:B6, and items from the insurance type (InsType) field are listed in C3:D3. A region name is entered in cell B2, and this is the cell that will change as the reports are printed.

2. In the summary table, use GETPIVOTDATA formulas to extract data from the pivot table. In cell C4, the formula is

=GETPIVOTDATA("Policies",InsurPivot!$A$5,"Region",$B$2,

"Status",$B4,"InsType",C$3)

3. Copy the formula down to the last row heading, and across to the last column heading.

4. Add row and column totals, if desired.

To create a scenario from the current summary, do the following:

1. Select cell B2, and on the Excel worksheet menu, choose Tools ➤Scenarios.

2. Click the Add button, and type East as the scenario name. Leave the default values in the other text boxes.

3. Click OK to open the Scenario Values dialog box, and click OK to confirm the values for the changing cells.

4. Click the Add button, and type the next region name, West, as the scenario name.

1 1 . 8 ■ U S I N G R E P O RT M A N A G E R : P R I N T I N G P I V OT TA B L E D ATA 232

5. Click OK to open the Scenario Values dialog box, type West as the value, and click OK.

6. Click the Show button to see the West region summary on the worksheet.

7. Click Close to close the Scenario Manager.

To create a report from the scenarios, follow these steps:

1. On the Excel worksheet menu, choose View ➤Report Manager.

2. Click the Add button, and type Region Summaries in the Report Name box, as shown in Figure 11-8.

3. From the Sheet dropdown, select the sheet that contains the summary report.

4. From the Scenario dropdown, choose one of the scenarios.

5. Click the Add button to add the scenario to the report.

6. Repeat Steps 3–5 for the remaining scenarios that you want to include in the printed report.

7. Click OK to close the Add Report dialog box, and click Close to close the Report Manager.

Figure 11-8. Create new reports in the Add Report dialog box.

1 1 . 8 ■ U S I N G R E P O RT M A N A G E R : P R I N T I N G P I V OT TA B L E D ATA 233

To print a report, do the following:

1. On the Excel worksheet menu, choose View ➤Report Manager.

2. Select a report in the Reports list, and click the Print button.

3. Enter the number of copies you want to print, and click OK.

How It Works

The GETPIVOTDATA formula uses an absolute reference to the region name cell ($B$2), and mixed references to the row and column heading cells, so the formula can be copied across and down:

=GETPIVOTDATA("Policies",InsurPivot!$A$5,"Region",$B$2,

"Status",$B4,"InsType",C$3)

For the row headings in cells B4:B6 the column is absolute, $B, and the row is relative.

When the formula is copied down or across, the formula will always refer to the data in column B in the current row.

For the column headings in cells C3:D3 the column is relative, C, and the row is absolute, $3. When the formula is copied down or across, the formula will always refer to the data in row 3 in the current column.

When printing the Region Summaries report, the Report Manager shows each selected scenario, prints the summary with that scenario visible, and then shows the next scenario.

235

C H A P T E R 1 2

■ ■ ■

Pivot Charts

When you create a PivotTable report, you can create a PivotChart report at the same time, or you can create a PivotChart report at any time later, based on one of the pivot tables in your workbook. A PivotChart report can’t be created on its own; it must be based on a PivotTable report. PivotChart reports are similar to normal Excel charts, but have some differences and limitations, as described in this chapter.

Một phần của tài liệu Excel PivotTables Recipe Book (Trang 255 - 260)

Tải bản đầy đủ (PDF)

(336 trang)