Printing MsChart Control

I use a MsChart Control. Is it possible to print the charts in visual C++ 6.0??? How do you do this?
Is it easier to program the charts???
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 This is an excerpt from the MSDN (October 1999):


The MSChart control does not expose a method that enables you to print the chart directly. However, you can use the PrintForm method to print the entire form containing the MSChart control. This article describes a method for printing only the chart.

You can print the chart of an MSChart control by copying the contents of the control using the EditCopy method, pasting the chart to a PictureBox control, and then printing the picture via the PaintPicture method of the Printer object:

Start a new Standard EXE project. Form1 is created by default.

Click Components on the Project menu. Check "Microsoft Chart Control" and click OK.

Draw an MSChart control and a CommandButton on Form1.

Click Add Form on the Project menu, select Form and click Open. This will add a form named Form2 to the project.

Draw a PictureBox control on Form2.

Add the following code to the Click event of Command1 on Form1:

      Printer.Print " "
      Printer.PaintPicture Clipboard.GetData(), 0, 0

Run the application. Click the CommandButton to print the chart to your default printer.

NOTE: The EditCopy method copies both the data and the picture of the chart to the clipboard. Then, when you use a Paste command to retrieve the contents of the clipboard, the receiving application determines whether the picture or the data is pasted. In this example, Picture1 requests the clipboard data and receives a picture of the chart rather than the chart's data.


   If you are using VC++, let me know and I can show you
how to use a printer DC to do this.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DegraveAuthor Commented:
Edited text of question.
DegraveAuthor Commented:
Thanks, but how can I print it with VC 6.0.
I can't find an answer on MSDN.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.