Default option for the DataSource property of a PivotTable is not displayed (820642)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSYou have a Microsoft Windows Form that contains a PivotTable ActiveX control.
When you try to set the DataSource property of the control in Windows Forms
Designer, you notice that the default option is not displayed in the drop-down
list of the DataSource property.
Note In Microsoft Visual Basic 6.0, the default options are displayed
in the drop-down list of the DataSource property.CAUSEThis behavior occurs because the PivotTable ActiveX control
does not support early binding of data source in Microsoft Visual Studio 2005 or in Microsoft Visual Studio .NET.
Therefore, the default option is not displayed in the drop-down list of the DataSource property in Windows Forms
Designer.WORKAROUNDTo work around this behavior, set the DataSource property of the PivotTable control
at runtime. To do this, follow these steps: - Add the following code to the Load event
of the Form1 form.
Microsoft Visual Basic 2005 or Microsoft Visual Basic .NET code'Create an instance of the PivotTable control.
Dim AxPivotTable2 As New AxOWC.AxPivotTable
'Set the datasource property of the control to the default option.
AxPivotTable2.DataSource = AxPivotTable2.GetOcx
'Add the control to the form.
Me.Controls.Add(AxPivotTable2) Microsoft Visual C# 2005 or Microsoft Visual C# .NET code//Create an instance of the PivotTable control.
AxOWC.AxPivotTable AxPivotTable2 =new AxOWC.AxPivotTable();
//Set the datasource property of the control to the default option.
AxPivotTable2.DataSource = (msdatasrc.DataSource)AxPivotTable2.GetOcx();
//Add the control to the form.
this.Controls.Add(AxPivotTable2); - On the Debug menu, click
Start.
STATUS This
behavior is by design.REFERENCESFor more information, visit the following Microsoft Developer Network (MSDN) Web
site:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005applies kbvs2005swept kbOfficeWebPivot kbProperties kbCtrl kbControl kbComCtrls kbWindowsForms kbPivotTable kbprb KB820642 kbAudDeveloper |
---|
|