CALLING IN THE A CRYSTAL REPORT IN VB 6
How do i call in a crystal report from:
(1) A form
(2) Crystal report viewer
Web Development
How do i call in a crystal report from:
(1) A form
(2) Crystal report viewer
by miss kitty
You need to add the Crystal Report Control and Viewer to your project. You do that under the Projects/components/reference.
Then here is an example of code that calls in the crystal viewer:
Dim crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Set Report = crxApplication.OpenReport _
("E:\PLTERA\CRYSTAL REPORTS\HAULER REPORTS\Contract Haulers Report.rpt", 1)
frmViewer.Show vbModal
On the form that has the viewer, here is a sample of the code for it:
Private Sub Form_Load()
'Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = frmReports.Report
CRViewer1.ViewReport
End Sub
This should get you going.
Cathy
This discussion is closed to new replies.
Sort by Trending