Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help me regarding the crystal report viewer.

Status
Not open for further replies.
Nov 5, 2004
27
PH
Hello, I am creating a program in vb 6.0 together with the crystal report viewer.here is the code.

Public rptApp As New CRAXDRT.Application
Public rpt As New CRAXDRT.Report


Private Sub Command1_Click()
CRV.Height = Form1.Height - 900
CRV.Width = Form1.Width - 150
rptpath = "F:\databse3\Purchasing\Reports&Printouts\crptPO_Sheet_com.rpt"

Set rpt = rptApp.OpenReport(rptpath, 0)


CRV.ReportSource = rpt
CRV.DisplayTabs = False
CRV.EnableSelectExpertButton = False
CRV.EnableDrillDown = False
CRV.EnableGroupTree = False
CRV.EnableAnimationCtrl = False
CRV.EnableSearchExpertButton = False
CRV.EnableCloseButton = True
CRV.ViewReport
End Sub

The problem here is that when i run the program a message appears telling that

"compile error:
user-defined type not defined" on

rptApp As New CRAXDRT.Application
rpt As New CRAXDRT.Report

I have put the crystal viewer object on the form named it as CRV.
Please help.Thanks.

 
Its better you add crystal report as a component of VB6
and use that component to design report it will automaticallu create a report and a form to invoke it with
sufficient code and code help
so that u may not need viewer crpaige32.dll etc
 
Just having the viewer control does not give all the functionality that you're requiring. You will need to add another reference to the Crystal Report x ActiveX Designer Library.

Depending on your version of Crystal, the actual name might be slightly different. After adding this reference you shouldn't get that error anymore.

>>Its better you add crystal report as a component of VB6

Why? I have always run into bugs with creating the reports straight in VB6 (at least with Version 8.5).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top