Page 1 of 1

Printed job missing text that is visible on the screen

Posted: Mon Jul 18, 2005 2:00 pm
by 9525700
Hello all

I would be grateful for some help on this matter

Essentially I cannot add any additional text to my printed report.
This is despite the fact that I can get it to appear on the screen.
Has anyone else had this?

----This code is there to do the after draw for my additional text

Private Sub tppPrint_OnAfterDraw()
'--Put the persons name on top of the report
With tppPrint.Canvas
.Font.Color = vbRed
.Font.Size = 12
.TextOut 400, _
90, _
gPatSearch.Name
End With
End Sub



Steps required as follows

'-- Set up TeePreview Panel (I show this to the user with the option to print)

tppPrint.Panels.Clear
tppPrint.AddChart tctGlaucoma(RIGHT_EYE)
tppPrint.AddChart tctGlaucoma(LEFT_EYE)
tppPrint.Repaint

'---After draw event kicks in and my added text is visible

'--- Then Print it

tppPrint.PrintPage

'---After draw kicks in again

However the printed output does not contain the text that I added and which appears on the screen.


regards

Andrew

Posted: Mon Jul 18, 2005 3:30 pm
by narcis
Hi Andrew,

This is a known problem already on our defect list to be fixed for future versions. In the meantime, TextOut X and Y positions have to be specified in values relative to the chart as shown in the example below.

Code: Select all

Private Sub Command2_Click()
    TeePreviewPanel1.PrintPage
End Sub

Private Sub Form_Load()
    For i = 0 To TChart1.SeriesCount - 1
        TChart1.Series(i).FillSampleValues 10
    Next i
    
    TeeCommander1.Chart = TChart1
    TeePreviewPanel1.Chart = TChart1
End Sub

Private Sub TChart1_OnAfterDraw()
    TChart1.Canvas.Font.Height = 40
    Form1.ScaleMode = 3 'Pixels
    X = TChart1.Series(0).CalcXPos(5)
    Y = TChart1.Series(0).CalcYPosValue(TChart1.Series(0).YValues.Maximum) - 50
    TChart1.Canvas.TextOut X, Y, "Hello!"
End Sub