Page 1 of 1
Print Preview Results
Posted: Wed Jan 09, 2008 6:12 pm
by 9527696
Hello,
After returning from the TeeChart Print Preview Page, I'd like to know how the window was closed. I'd like to know if the user pressed the "Print" or "Close" button. Is there a way to determine this?
Thank you,
Jennifer Britt
Posted: Tue Jan 15, 2008 10:11 pm
by 9527696
Hello,
Here is some more specific information for this post
I want to print multiple pages of the same graph, where the tchart is modified for each printed page. Ideally, I'd like to display the ShowPreview page to allow the user to set up the printer, etc. Then, I'd like to know what the user entered. For example, if the user pressed "Cancel" from the "ShowPreview" page, then nothing would be printed.
Code: Select all
printer.ShowPreview();
if (bPrint)
{
for (int i = pageBegin; i < pageEnd; i++)
{
myData[i].series.SetActive(true);
SetGraphTitle(myData[i].title);
printer.PrintChart();
myData[i].series.SetActive(false);
}
}
If there is no way to do this now, will there be a way to do this in the future?
Thank you, as always, for any help.
Posted: Thu Jan 17, 2008 8:36 am
by Pep
Hi Jenn,
at this moment there's not a way to check it with the latest teechart version. The only way around would be in case you call the PrintChart manually (via code). In that way you will be able to use the OnBeforePrintChart event to check if chart is printed (I mean that if chart is printed this event will be called). This event is not called if the Chart is printed through the editor or previewer.
I've added this as a wish for the next maintenance releases (the ShowPreview call could return a boolean to know if print has been clicked or not).
Posted: Thu Jan 17, 2008 5:37 pm
by 9527696
Thank you Josep! The return value from ShowPreview will be very helpful, but in the meantime, the OnBeforePrint event will let me do what I need to do.
Thank you very much for your advice!
Jenn