Author |
Topic  |
|
wv_wayne
2 Posts |
Posted - 18 Mar 2005 : 11:04:55
|
Looking for some example in C# for printing options.
First I need to set paper orientation. Second I would like to enlarge my charts to fill the paper better.
Thanks, Wayne |
|
quinncurtis
1164 Posts |
Posted - 18 Mar 2005 : 13:25:47
|
The ChartOfTheWeek12-31-03 example has a complete printing example. Normally portrait or landscape mode is selected from the PrinterSetup or PageSetup dialogs. If you want to set portrait or landscape mode under program control without a dialog, use the PrintPageSettings.LandScape property of the ChartPrint object.
The printing routines will NOT change the aspect ratio of the graph on the screen. The aspect ratio will always match that of the underlying ChartView object. The documentation is in error about this.
If you want to use the entire printable area of a 11x8.5 sheet, you will need to give the underlying ChartView an approximately 11.5 x 8.5 aspect ratio. Set the margins of the PrintPageSetgings to all 0.0, or some small number representing the printable region of the paper.
public void PrintPage(object sender, System.EventArgs e) { ChartView chartVu = this; if (chartVu != null) { if (printobj == null) { printobj = new ChartPrint(chartVu, ChartObj.PRT_MAX); printobj.DoPrintDialog(); } else printobj.PrintChartView = chartVu;
printobj.PrintSizeMode = ChartObj.PRT_MAX; printobj.PrintPageSettings.Landscape = true; printobj.PrintPageSettings.Margins = new Margins(0,0,0,0);
printobj.DocPrintPage( sender, e); } }
|
 |
|
wv_wayne
2 Posts |
Posted - 18 Mar 2005 : 13:45:58
|
Thank you.
That is very helpful. |
 |
|
|
Topic  |
|
|
|