Creating a Pivot Table Report from an External Data Source

You can use the same PivotTableWizard method of the Worksheet object (demonstrated in the previous example procedure) to create a PivotTable report from an external data source. We will look at two examples that pull data for the PivotTable from a Microsoft Access database. The first one will use a Microsoft Access driver to connect to a Microsoft Access database and then use the PivotTableWizard method to create an empty PivotTable. The second example will employ a newer technology known as ADO (ActiveX Data Objects) to obtain the data and will then use the PivotCaches collection to create a new PivotCache; it will use the CreatePivotTable method of the PivotCache object to create an empty PivotTable. In both examples we will also set the Orientation property of the retrieved fields to populate the PivotTable report with the data.

0 0

Post a comment