Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Printing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wv_wayne

2 Posts

Posted - 18 Mar 2005 :  11:04:55  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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);
}
}
Go to Top of Page

wv_wayne

2 Posts

Posted - 18 Mar 2005 :  13:45:58  Show Profile  Reply with Quote
Thank you.

That is very helpful.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07