Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding Chart to Pivottable

Status
Not open for further replies.

Gauss

Programmer
May 1, 2002
17
0
0
DE
Hello!

I have a Pivottable on a form connected to an OLAP cube
via VB. How can I bind a chartspace to my pivottable, that
changes when user-actions change the Table (for example adding a measure to the data-field)?
Does anyone know an "simple" way to synchronize table and chart?

I'm using Office Web Components from Office 2000 SR1,VB 6
and SQL 2000 (Enterprise Edition) Analysis Service.

Thanks in advance.
 
Have you been able to find out any information with regard to your question? I have run into the same problem and have spent more than 2 weeks trying to solve it and and still can't get it right. If you have a found a solution what is it please, this is driving me crazy?
 
We upgraded to OfficeXP. With OWC10 binding Pivottable to Chart is very easy.
 
Thanks, unfortunately I have to use the OWC 9.0 because of licensing, I have been told I need a license for each PC the app will run on for Office XP. Any ideas as to were I could find info on how to do bind the chart and pivot table as you originally had a problem doing?
 
Try this:

Code:
Private Sub ChartRefresh()
Dim newchart
Dim c
Dim n As Integer

ChartSpace1.EnableEvents = False
Set c = ChartSpace1.Constants
ChartSpace1.Clear
Set ChartSpace1.DataSource = PivotTable1
Set newchart = ChartSpace1.Charts.Add
newchart.Type = c.chChartTypeColumnClustered
newchart.HasLegend = True
    
  newchart.SetData c.chDimSeriesNames, 0, chPivotColAggregates
  newchart.SetData c.chDimCategories, 0, c.chPivotRowAggregates
       
  For n = 0 To newchart.SeriesCollection.Count - 1
        newchart.SeriesCollection(n).SetData c.chDimValues, 0, n
        newchart.SeriesCollection(n).SetData c.chDimValues, 0, n
  Next
    
ChartSpace1.EnableEvents = True
End Sub

Use this sub to establish first binding to Pivottable and every time when the DataSetChange-Event of the Chartspace is firing.

Regards
Gauss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top