Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 Real-Time Graphics Tools for .Net (VB and C#)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]


T O P I C    R E V I E W
johnny Posted - 23 May 2006 : 05:59:44
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
3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 24 May 2006 : 08:52:04
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.PrintChartView = chartVu;

    printobj.PrintSizeMode = ChartObj.PRT_MAX;
    printobj.PrintPageSettings.Landscape = true;
    printobj.PrintPageSettings.Margins = new Margins(0,0,0,0);

    printobj.DocPrintPage( sender, e); 

johnny Posted - 24 May 2006 : 07:51:56
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
but it always returns portrait.
I've tried to change the LinePlotSalesVolume to do the same but without success.
quinncurtis Posted - 23 May 2006 : 10:52:59
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?

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07