Dynamic Chart with OWC11 PivotTable

E

Eyal

Hello all.

Does anyone know how to dynamically modify an OWC11 chart (ChartSpace) to
interact with an OWC11 PivotTable?
I'm not looking to genorate a static gif/jpg with a result from the server..
I'm actually looking to have the Chart reflect direct responses from the
OWC11 PivotTable on my web page.

Any help will do.
Thank you all in advance!

- Eyal.
 
A

Alvin Bruney [MVP]

The chart can source its data directly from a pivot table because the pivot
table implements idatasource. Just set the datasource property to the pivot
table list object. You need to make sure that the pivot table is located on
the same domain otherwise the load will fail.
I'm not looking to genorate a static gif/jpg with a result from the
server..
I'm actually looking to have the Chart reflect direct responses from the
OWC11 PivotTable on my web page.
I don't know what you mean by this. If you are referring to interactivity,
you will need to make sure that the user has a valid run-time license


--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
 
E

Eyal Zinder

Alvin,

Thank you for your help.

Can you direct me to a sample script that shows how to implement the
two?
 
A

Alvin Bruney [MVP]

From page 138 of the Office Web Components Black Blook with .NET


Let us examine the code to load data from a Pivot Table.




Code-listing 4.12 Sample code to bind to a Pivot Table




C# snippet




ChartSpace1.DataSource = pivottable1.

SetData(ChartDimensionsEnum.chDimCategories, (int)

ChartSpecialDataSourcesEnum.chDataBound,




pivottable1.ActiveView.ColumnAxis.FieldSets("Vehicle").Fields("Year"));

pivottable1.SetData(ChartDimensionsEnum.chDimValues, (int)

ChartSpecialDataSourcesEnum.chDataBound




pivottable1.ActiveView.ColumnAxis.FieldSets("Vehicle").Fields("Model"));




VB.NET snippet




ChartSpace1.DataSource = pivottable1

SetData(ChartDimensionsEnum.chDimCategories, CType

(ChartSpecialDataSourcesEnum.chDataBound,

pivottable1.ActiveView.ColumnAxis.FieldSets("Vehicle").Fields("Year"),
Integer))




pivottable1.SetData(ChartDimensionsEnum.chDimValues,CType

(ChartSpecialDataSourcesEnum.chDataBound




pivottable1.ActiveView.ColumnAxis.FieldSets("Vehicle").Fields("Model"),
Integer))








--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
 

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

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top