Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mistake on Microsoft MSDN article?

Status
Not open for further replies.

x508

Programmer
Jun 26, 2003
396
ZA
Hi.

I recently posted a question about printing the MsChart.

Dr. JavaJoe helped me by refering me to the following link.


This page suggests that I can do this to print the MsChart control, but I'm sure that they are missing something, cause it didn't work for me...

It seems to me that they have missed a line of code, not?

This is there code:

MSChart1.EditCopy
DoEvents ' may be needed for large datasets
Printer.Print " "
Picture1.PaintPicture Clipboard.GetData(), 0, 0
Printer.EndDoc

But they should have added this line:

MSChart1.EditCopy
DoEvents ' may be needed for large datasets
Printer.Print " "
Picture1.PaintPicture Clipboard.GetData(), 0, 0

*** Printer.PaintPicture Picture1.Image,0,0

Printer.EndDoc

I was just wondering.....


**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Hello,
I was reading your post and also went to the MSDN website. I do presure that you are right there is at list one line missing and also it does not tell the user that he/she should place a Imagebox on the form.
The ony problem I have is that it prints a grey box that's all. it displays data and the graph in the picturebox but not on the sheet when printing. did you have more luck ?
Thanks
Paolo
 
Er...you don't need an Imagebox

It is also worth pointing out that the actual error in the example is that whoever wrote it tested with a picturebox, and then failed to convert it fully to a printer. The example should read:
Code:
[COLOR=blue]    MSChart1.EditCopy
    DoEvents   [green]' may be needed for large datasets[/green]
    Printer.Print " "
    [b]Printer[/b].PaintPicture Clipboard.GetData(), 0, 0
    Printer.EndDoc
[/color]
 
Did you give them some feedback on this? There's usually a link at the bottom of the page for this.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top