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
 Real-Time Graphics Tools for .Net (VB and C#)
 PageSettings
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

johnny

2 Posts

Posted - 23 May 2006 :  05:59:44  Show Profile  Reply with Quote
Hello.
I'm having problems accessing the PageSettings object of the ChartPrint. I use the following code and after changing the PageSettings with the PageSetupItem method I can't access those changes. For excample I change the page to landscape and go to print preview, the page changes to landscape but printobj.GetPageSettings().Bounds returns portrait dimensions so the chart will be in portrait but the page in landscape. And any changes I do to the PageSettings do not register.
Any ideas?

Dim printobj As New ChartPrint(theChart, ChartObj.PRT_MAX)

Private Sub PageSetup_Button(ByVal sender As Object, ByVal e As System.EventArgs)
printobj.PageSetupItem(sender, e)
End Sub

Private Sub PrintPreview_Button(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewButton.Click
Dim Rect As Rectangle = printobj.GetPageSettings().Bounds
Dim RectSize As Size = Rect.Size
theChart.Size = RectSize
printobj.PrintPreviewItem(sender, e)
End Sub

quinncurtis

1531 Posts

Posted - 23 May 2006 :  10:52:59  Show Profile  Reply with Quote
Sorry, I can't follow the logic.

Starting with our LinePlotSalesVolume example program, I select Page Settings from the menu and change the page settings to Landscape. When I go to Print Preview, both the page and the chart are in Landscape. When I print, the chart comes out in Landscape.

Are you saying that something else happens when you run that example program and change the orientation, using the menu option, to Landscape?
Go to Top of Page

johnny

2 Posts

Posted - 24 May 2006 :  07:51:56  Show Profile  Reply with Quote
What I'm trying to do is to use all the paper area when printing, whether it is in portrait or landscape. To do that I have to resize the chart based on the orientation. I've tried using
printobj.GetPageSettings().Bounds
and
printobj.GetPageSettings().Landscape
but it always returns portrait.
I've tried to change the LinePlotSalesVolume to do the same but without success.
Go to Top of Page

quinncurtis

1531 Posts

Posted - 24 May 2006 :  08:52:04  Show Profile  Reply with Quote
If eliminating the printer margins is your goal, you are going about it wrong. You don't have to resize the graph, regardless of the orientation. You would just use the ChartPrint.PrintPageSettings.Margins property to set the margins.

An earlier post in the QCChart2D forum, titled Printing, from March 2005 discusses this.

Set the margins of the PrintPageSetgings to all 0.0, or some small number representing the printable region of the paper.

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. 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, either Landscape or Portrait.


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