is there something like onAfterPrintTchart event and more..?

TeeChart for ActiveX, COM and ASP
Post Reply
GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

is there something like onAfterPrintTchart event and more..?

Post by GLSWG » Fri Jun 03, 2005 5:18 pm

Hi,

1) While printing the chart I am faced with some problems with font of canvas which is changed to extremely large size for printout. How can I keep it the same size as it is before print?

2) I am changing some chart look and feel properties for printout in OnBeforePrint and after a print I need to change them back for normal display. But I can't seem find a way to do it because there is no event signaling of print has been finished. Any ideas on these issues?

As always thank you for any help. I do appreciate it.

Michael.

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Mon Jun 06, 2005 2:30 pm

Any ideas? Thanks.

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Wed Jun 08, 2005 11:31 am

Actually great support forum :?

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jun 08, 2005 3:20 pm

Hi Michael,

sorry for delay.
1)
This may occur on output to some Printers. It can normally be resolved by setting Font.Height instead of Font Size. The helpfile topic for Font.Height gives a few more details about use. Also, to see the correct results you'll have to create an .exe file from your project and print from there

2)
You could change the aspect of the Chart in the OnBeforePrint event, export the chart to stream or file and after the it has been printed, import it again.
Dim Stream
Stream = TChart1.Export.asNative.SaveToStream(False)
TChart1.Import.LoadFromStream Stream

GLSWG
Newbie
Newbie
Posts: 39
Joined: Fri Jan 09, 2004 5:00 am

Post by GLSWG » Fri Jun 10, 2005 12:19 pm

Hi Pep,

Thank you for reply. But given attention to issue #2, how I still find out if printing finished. As I understood your idea is

1) Export the chart to stream with regular view before print
2) chage look and feel for pritnout in OnBeforePrint which is ok
3) Import the chart from the stream after the print. But how can I know when the printing finished?

In the OnBeforePrint I am setting m_bPrinting = TRUE and OnAfterDraw knowing the m_bPrinting value I am applying look and feel changes. But I need an event where I can set m_bPrinitg = FALSE and import the chart which was before print or just OnAfterDraw knowing that print was finished m_bPrinting = FALSE to revert to normal chart properties.

Thanks.

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jun 20, 2005 2:03 pm

Hi,

3) You will have to put your code after the :
TChart1.Printer.PrintChart line.

Post Reply