Print Preview Results

TeeChart for ActiveX, COM and ASP
Post Reply
Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Print Preview Results

Post by Jenn » Wed Jan 09, 2008 6:12 pm

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

Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Post by Jenn » Tue Jan 15, 2008 10:11 pm

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.

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

Post by Pep » Thu Jan 17, 2008 8:36 am

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).

Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Post by Jenn » Thu Jan 17, 2008 5:37 pm

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

Post Reply