Printed job missing text that is visible on the screen

TeeChart for ActiveX, COM and ASP
Post Reply
dineena
Newbie
Newbie
Posts: 8
Joined: Fri Jan 21, 2005 5:00 am

Printed job missing text that is visible on the screen

Post by dineena » Mon Jul 18, 2005 2:00 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jul 18, 2005 3:30 pm

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply