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.
is there something like onAfterPrintTchart event and more..?
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
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
Pep Jorge
http://support.steema.com
http://support.steema.com
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.
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.
Hi,
3) You will have to put your code after the :
TChart1.Printer.PrintChart line.
3) You will have to put your code after the :
TChart1.Printer.PrintChart line.
Pep Jorge
http://support.steema.com
http://support.steema.com