Question about Print Preview window
Posted: Fri Aug 25, 2006 3:57 pm
I use the print preview window in my application to display a graph for printing by the following code:
The problem is this: I view the print preview window; I click "Setup..." and change the paper size, and click "OK".
Now the print previewer shows the correct paper size, but the graph is the wrong size (in the control). For example, if I chose a larger paper size (8.5"x14" when before I had 8.5"X11") the graph will not fill the printable area of the page.
The graph will still print correctly though.
I need to use the Printer.Print(rectangle r) overload so I can include some images in the ChartPrint event.
I'm using C# .NET 2005 and TeeChart Pro Version 2.0.2306.26232.
Code: Select all
RectangleF rectfTemp = graphData.Printer.PrintDocument.DefaultPageSettings.PrintableArea;
graphData.Printer.BeginPrint();
graphData.Printer.Print(new Rectangle((int)rectfTemp.X, (int)rectfTemp.Y, (int)rectfTemp.Height, (int)rectfTemp.Width - 100));
graphData.Printer.Preview();
Now the print previewer shows the correct paper size, but the graph is the wrong size (in the control). For example, if I chose a larger paper size (8.5"x14" when before I had 8.5"X11") the graph will not fill the printable area of the page.
The graph will still print correctly though.
I need to use the Printer.Print(rectangle r) overload so I can include some images in the ChartPrint event.
I'm using C# .NET 2005 and TeeChart Pro Version 2.0.2306.26232.