Page 1 of 1

Using TeeChart in PowerPoint

Posted: Fri Dec 08, 2006 12:41 am
by 9529277
Hi,

I am looking for ways to present some of the 3D charts generated by my application.

So I have been playing around with PowerPoint. I place the following controls on a slide:
- TeeChart Pro ActiveX control v7
- TeeChart Commander v7
I import a .tee file into the TChart.

The major problem is that when each time the slide is viewed, both controls get larger and larger. I can use Visual Basic code to set the size and location of each control but I am unsure where to put the code.

Neither of the two automatically generated functions seem appropiate:

TChart1_OnAfterDraw()
TeeCommander1_OnEditedChart()

Furthermore, I am not sure of the correct place to put the code for associating the toolbar with the chart. Currently it is in TChart1_OnAfterDraw, but I don't think this is correct.

I am a C++ programmer so my knowledge of Visual Basic is limited.

I'd be grateful for any advice,

Cheers
Russell Thamm

Posted: Mon Dec 11, 2006 2:57 pm
by narcis
Hi Russell,

There is an incompatibility with TeeChart sizing and Powerpoint that makes sizing difficult to manage on a PPT page. The cleanest solution is to compile TeeChart into a UserControl and place the UserControl in the page.

Steps to take:

1. Make VB UserControl project (I'll send to your forums e-mail address account an example project and its generated .ocx file included)
2. Compile and register project (can be registered via last option in import control list in Powerpoint if preferrable)
3. Make Powerpoint example using the UserControl. The example usercontrol is Called TeeChartPPT and can be found in the list of ActiveX controls after it is registered

The example project included will work to show all the steps.

Please note that if you make changes to the UserControl after having used it in Powerpoint you should delete the temporary file (.exd) created by Powerpoint in the following folder:

C:\Documents and Settings\Administrator\Local Settings\Temp\PPTxx.x

Posted: Thu Dec 14, 2006 1:56 am
by 9529277
Hi Narcis,

thanks very much for your reply.

I am a rank newbie when it comes to Visual Basic, but I have managed to create a UserControl containing a TChart and a TeeCommander and have resizing working properly.

I want to load a file at design time ie when I place the UserControl on a PowerPoint slide. When I place a TChart in PowerPoint, the context menu has an "Import" item which I can use to load a tee file.

The UserControl doesn't have this option. Is there any way to easily expose the "Import" item in the UserControl?

Cheers
Russell

Posted: Thu Dec 14, 2006 9:47 am
by narcis
Hi Russell,

Yes, you could add a button or menu option in the UserControl which loads a .tee file as shown in "Tutorial 12 - Exporting and Importing Charts". You'll find the tutorials at TeeChart's program group.