Hai,
Using VB6 i code to add and display Crystal report. The printing option works only we click the icon in menu bar. when I used to Press 'Ctrl+P', it won't work in the form as how it works usually in Cryastal Report Application.
Please let me have function of 'Ctrl+P' in VB itself. My coding is as follows
CODE
Private Sub cmdprint_Click()
If IsNull(dtcCustomer.Text) Then MsgBox "Select Customer ": dtcCustomer.SetFocus: Exit Sub
If Combo1.Text = "Clicking" Then
If Not dtcCustomer.Text = "Bostonian" Then
Selected_Report_Path = "E:\log\CheckList-Upper.rpt"
Else
Selected_Report_Path = "E:\log\CheckList -Upper(Bost).rpt"
End If
If Selected_Report_Path <> Empty Then
Dim crystal As CRAXDRT.Application
Dim report As New CRAXDRT.report
Set crystal = New CRAXDRT.Application
Set report = crystal.OpenReport(Selected_Report_Path)
report.ParameterFields(1).AddDefaultValue dtcCustomer.Text
report.ParameterFields(2).AddDefaultValue txtOrderNo.Text
report.ParameterFields(3).AddDefaultValue dtcPlanNo.Text
report.ParameterFields(4).AddDefaultValue "Upper Leather 1"
report.DiscardSavedData
CRViewer91.ReportSource = report
CRViewer91.ViewReport
CRViewer91.EnableCloseButton = True
CRViewer91.EnablePrintButton = True
End If
Else
End If
sorry i wrote in 'Computer support & operating system' Group . it is to be in Visual Basic group
This post has been edited by jayman9: 27 Aug, 2008 - 09:45 AM