Page 1 of 1

No chart on print preview

Posted: Thu Jun 19, 2014 1:14 pm
by 15666633
Hi, i want to create a print document with standard TeeChart tool, i use to draw Chart using Print(Rectangle rect) method, which i call in Print page event, which appears when i call Preview() method of TeeChart.Printer, and used to draw Chart and some extra strings. But there is no cghart on this preview, but if i try to zoom the preview, it appears. What should i do to get chart printed without zooming. I attached simple project, that reproduces problem.

Re: No chart on print preview

Posted: Thu Jun 19, 2014 3:00 pm
by narcis
Hi Petr,

That's similar to what I explained here. So, instead of calling:

Code: Select all

      //tChart1.Printer.Print(m_PrintRect);
you should call:

Code: Select all

      //tChart1.Printer.Print(m_PrintRect);
      System.Drawing.Imaging.Metafile m = tChart1.Chart.Metafile(tChart1.Chart, m_PrintRect.Width, m_PrintRect.Height);
      ev.Graphics.DrawImage(m, m_PrintRect, tChart1.Chart.ChartBounds, GraphicsUnit.Pixel);

Re: No chart on print preview

Posted: Fri Jun 20, 2014 9:39 am
by 15666633
Hi Narcis, thanks for the response, that works, but on the document appears two lines, on the left and bottom edge, how can i remove them?

Re: No chart on print preview

Posted: Fri Jun 20, 2014 10:11 am
by narcis
Hi Petr,

Try setting the outer bevel to nothing:

Code: Select all

      tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
Does this solve the problem for you?