.PrintPartialHandle adds a "4" in the chart printo

TeeChart for ActiveX, COM and ASP
Post Reply
Joen
Newbie
Newbie
Posts: 2
Joined: Tue Apr 08, 2003 4:00 am
Location: Netherlands
Contact:

.PrintPartialHandle adds a "4" in the chart printo

Post by Joen » Mon May 02, 2005 6:41 am

Hi

I'm using Teechart 6.003 AX.
When I print a chart via PrintPartialHandle it some how prints a number "4" in the printout of the chart.
I tested it also via the PrintPreview window, where it was reproducable. The only thing I do during printing is Switching off the background color, switching off an annotationtool (in use for displaying mouse coordinates) and resize the chart to to fit it on the paper.

I found that the position where the "4" is printed is dependend on the sizing and the level of details from the print. Without resizing the chart I even don't see it at all.

Do you have any idea where this "4" is comming from?

Kind regards

Jeroen de Witte

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri May 06, 2005 7:06 am

Hi Jeroen,

I cannot reproduce the problem here using the v6.0.0.6 and the following code (from the help file) :

Code: Select all

Private Sub Command1_Click()
Dim HWidth, HHeight, ChartLeft, ChartTop, ChartRight, ChartBottom ' Declare variables.

    On Error GoTo ErrorHandler  ' Set up error handler.
    Printer.Orientation = vbPRORPortrait
    'Scale & position text.
    HWidth = Printer.TextWidth(Text1.Text) / 2 ' Get half width.
    HHeight = Printer.TextHeight(Text1.Text) / 2   ' Get half height.
    Printer.CurrentX = Printer.ScaleWidth / 3 - HWidth
    Printer.CurrentY = Printer.ScaleHeight / 3 - HHeight

    Printer.Print Text1.Text ' Print 1st Text box
    With TChart1.Printer
      'Chart needs to orientated separately

      .Orientation = poPortrait
      'Set the chart position
      ChartLeft = .PageWidth / 3
      ChartTop = (.PageHeight / 3) + 30
      ChartRight = (.PageWidth / 3) * 2
      ChartBottom = (2 * (.PageHeight / 3)) - HHeight - 10
      'Attach the Chart output to the open print job
      .PrintPartialHandle Printer.hDC, ChartLeft, _
            ChartTop, ChartRight, ChartBottom

    End With
    Printer.CurrentY = 2 * Printer.ScaleHeight / 3 - HHeight
    Printer.CurrentX = Printer.ScaleWidth / 3 - HWidth

    Printer.Print Text2.Text ' Print 2nd Text box
    Printer.EndDoc  ' Printing is finished.
    Exit Sub
    
ErrorHandler:
    MsgBox "There was a problem printing to your printer."
    Exit Sub
End Sub
Are you sure this "4" is not any label you've around the Chart ? If so, could you please post the code to reproduce "as is" here ?

Post Reply