Linking PivotTable to ChartSpace

R

Raj More

Hello,

I am display data from an OLAP source into a PivotTable control in a VB.Net windows application.

Now, I want my users to be able to select the two items, one from the RowAxis and one from the TotalAxis to display it in the chart. I have found several sites that display source code as to how this can be done on the web, but they all use the NorthWind database. I want to do the same thing using my OLAP cube, but the last parameter of the SetData command is where I am messing things up.

Here is the syntax I am using:

Me.AxChartSpace.Charts(0).SetData(OWC10.ChartDimensionsEnum.chDimCategories, 0, Me.AxPivotTable.ActiveView.FieldSets(0))
Me.AxChartSpace.Charts(0).SetData(OWC10.ChartDimensionsEnum.chDimValues, 0, Me.AxPivotTable.ActiveView.Totals(0))

This gives me the following error:

'CubIQ.exe': Loaded 'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml..dll', No symbols loaded.
System.Runtime.InteropServices.COMException (0x80004005): Unknown error

at OWC10.ChChart.SetData(ChartDimensionsEnum Dimension, Int32 DataSourceIndex, Object DataReference)

at CubIQ.Frm_CubIQ_BuildQuery_DisplayData.Cmd_Show_Graph_Click(Object sender, EventArgs e) in C:\Documents and Settings\rajm\My Documents\Visual Studio Projects\Qubic\CubIQ\Forms\Frm_CubIQ_BuildQuery_DisplayData.vb:line 1194


I have tried replacing "Me.AxPivotTable.ActiveView.FieldSets(0)" with just names like "Contact_Date" or "Country" as is shown in the demo applications. It still returns the same error.

Can anyone point out what I am doing wrong here, and what I should be doing to achive what I want?

Thanks in advance,

Raj More
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top