Page 1 of 1
v6 Printing
Posted: Wed Jan 25, 2006 8:14 am
by 9083304
I have two controls stacked on top of one another which to the user looks like a single complex chart.
On printing I want both controls to print on one page so the print-out looks the same as on the screen.
Can I do this?
Thanks
Ross
Posted: Wed Jan 25, 2006 8:48 am
by narcis
Hi Ross,
Yes, this is possible, there's an example of that at TeeChart Pro v7 ActiveX features demo. You may want to try doing this with v6, the code for the example is:
Code: Select all
Private Sub Combo1_Change()
Combo1_Click
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex
Case 0: AddCharts 0, 1
Case 1: AddCharts 1, 1
Case 2: AddCharts 2, 2
End Select
End Sub
Private Sub Command1_Click()
TeePreviewPanel1.PrintPage
End Sub
Private Sub Form_Load()
TChart1.Series(0).FillSampleValues 10
TChart2.Series(0).FillSampleValues 10
With TChart1.Printer
.PrintProportional = False
.MarginLeft = 2
.MarginTop = 2
.MarginRight = 60
.MarginBottom = 60
End With
With TChart2.Printer
.PrintProportional = False
.MarginLeft = 60
.MarginTop = 60
.MarginRight = 2
.MarginBottom = 2
End With
Combo1.ListIndex = 0
'AddCharts 0, 1
End Sub
Private Function AddCharts(Choice, Active As Integer)
TeePreviewPanel1.Panels.Clear
Select Case Combo1.ListIndex
Case 0:
If Active = 1 Then
TeePreviewPanel1.AddChart TChart1
TeePreviewPanel1.AddChart TChart2
Else
TeePreviewPanel1.AddChart TChart2
TeePreviewPanel1.AddChart TChart1
End If
NumCharts = 2
Case 1: TeePreviewPanel1.AddChart TChart1
NumCharts = 1
Case 2: TeePreviewPanel1.AddChart TChart2
NumCharts = 1
End Select
TeePreviewPanel1.Repaint
Label3.Caption = "Active Chart: TeeChart " & Active
If Active = 1 Then
TChart1.Panel.BevelInner = bvLowered
TChart2.Panel.BevelInner = bvNone
Else
TChart1.Panel.BevelInner = bvNone
TChart2.Panel.BevelInner = bvLowered
End If
End Function
Private Sub TChart1_OnClick()
If NumCharts = 2 Then
AddCharts 0, 1
TChart1.Panel.BevelInner = bvLowered
TChart2.Panel.BevelInner = bvNone
End If
End Sub
Private Sub TChart2_OnClick()
If NumCharts = 2 Then
AddCharts 0, 2
TChart1.Panel.BevelInner = bvNone
TChart2.Panel.BevelInner = bvLowered
End If
End Sub