General discussion

Locked

CALLING IN THE A CRYSTAL REPORT IN VB 6

By canzee2000 ·
How do i call in a crystal report from:
(1) A form
(2) Crystal report viewer

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Miss Kitty In reply to CALLING IN THE A CRYSTAL ...

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

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums