Page 1 of 1

Copying a TeeChart

Posted: Thu Sep 21, 2006 3:01 pm
by 9528399
Hello TeeChart crew,
I am a new member here.I have some questions.

1)I have a winform with 2 tabcontrols each tabcontrol containing 2 tabpages.How to copy a particular tabpage with teecharts on it and paste in MSWord?

2)Can we copy a particular teechart without exporting it?

3)Can we right click on a teechart on tabpage and have some menucontrols like copy,print etc?

Thanx in advance.

Regards

Posted: Thu Sep 21, 2006 3:26 pm
by narcis
Hi vijay,

Please find below the answers to your questions:

1. To copy a TChart to the clipboard you need to use something like this:

Code: Select all

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Export.Image.JPEG.CopyToClipboard();
    }
If you need to copy the full TabPage you will have to loo for how this control is copied to the clipboard, for example:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxmancli/html/25152454-0e78-40a9-8a9e-a2a5a274e517.htm


2. No, you'll need to copy the chart to a native template file (.ten), a MemoryStream or an image as shown above.


3. You can do this:

Code: Select all

    private void tChart1_MouseClick(object sender, MouseEventArgs e)
    {
      if (e.Button == MouseButtons.Right)
      {
        tChart1.ShowEditor();
      }
    }
Or use a ContextMenu where the desired commands are implemented for each menu option.

Posted: Thu Sep 21, 2006 3:47 pm
by 9528399
Thanx a lot for your quick response

Posted: Thu Sep 21, 2006 3:59 pm
by 9528399
When I export it as bmp/jpeg/png ..its fine,but when Im trying to copy that Image into a word document..its copying only bottom axis...
Same problem even when I used copytoclipboard.

Posted: Thu Sep 21, 2006 4:02 pm
by narcis
Hi vijay,

It works fine for me here using latest Debug Build version available at the client area. Which TeeChart version are you using?

If the problem persists could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Posted: Thu Sep 21, 2006 4:11 pm
by 9528399
Im using
"TeeChart.NET version 2
Build 2.0.2306.26233"
Its a huge project..Im afraid I cant post these files :(

Posted: Thu Sep 21, 2006 4:47 pm
by 9528399
Sorry..It was some setting problems in MSWord..Now its fine..
Thanx for ur help.

Posted: Fri Sep 22, 2006 9:25 am
by 9528399
As I have many TeeCharts on one tabpage,can I render them into a DIB(Device Independent Bitmap) so that I can copy/print all of them at a time?

Posted: Fri Sep 22, 2006 10:32 am
by narcis
Hi vijay,

You could try using TeeChart's Bitmap exporting feature. You could also use tChart1.Draw method and draw in the canvas you want. The forums threads below may be helpful as well:

http://www.teechart.net/support/viewtopic.php?t=1883
http://www.teechart.net/support/viewtopic.php?t=2053
http://www.teechart.net/support/viewtopic.php?t=3022