|
-
Nov 27th, 2000, 03:50 PM
#1
Thread Starter
Hyperactive Member
Hi all,
I posted a question about how to use Crystal Report, and I
got a sample from DavidRobin, but I could not figure it out.
I paste the code he provided, but it would not compile. The
compiler is complaining that the User-defined type not defined and the lines it does not like are the two
dims below:
Dim Appl As CRAXDRT.Application
Dim Report As New CRAXDRT.Report
What Project->References or Project->Components must I
attach?
Here is the sample code David provided:
' holds the report file path
Private mRepFile As String
Private Sub Form_Load()
Set Appl = New CRAXDRT.Application
Set Report = Appl.OpenReport(mRepFile)
Report.DiscardSavedData
Report.Database.Tables(1).SetLogOnInfo <database>, , <UserID>, <password>
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
CRViewer1.Top = 0
CRViewer1.Left = 0
End Sub
Private Sub Form_Resize()
' keeps the CRViewer the same size as the form
CRViewer1.Width = Me.ScaleWidth
CRViewer1.Height = Me.ScaleHeight
End Sub
' Property to allow the report path to be passed in
Property Let ReportFile(rep As String)
mRepFile = rep
End Property
Private Sub Form_Unload(Cancel As Integer)
Set Appl = Nothing
Set Report = Nothing
End Sub
Private Sub mnuOutstanding_Click()
frmReportView.ReportFile = App.Path & "\Students.rpt"
frmReportView.Caption = "Crystal Report Viewer [Students.rpt]"
frmReportView.Show vbModal
frmReportView.ReportFile = ""
Set frmReportView = Nothing
End Sub
-
Nov 27th, 2000, 04:19 PM
#2
The answer is probably contained in davidRobin's original answer when he said
Ensure the references are set in the Project menu for any project that uses this form:
Cristal Report Viewer Control
Cristal Report 8 ActiveX Designer Run Time Library
(the 8 is version 8 that we use, you may have a different version)
Create a new form and place the CRViewer control on it and paste the following code on the form:
I assume he meant "Crystal" and not "Cristal" but in either case I don't find either of them in my Project>References, so I further assume that he installed a stand-alone version of Crystal reports.
-
Nov 27th, 2000, 05:02 PM
#3
Thread Starter
Hyperactive Member
Is Crystal Report not a part of MSVB?
Yes, I tried to find what DavidRobin suggested, but could
not find such thing or anything that is close to that.
This is kind a dump, but where can I find more information
about Crystal Report? Is it part of MS VB or do I have
to purchase it separately, and if it separate where can
find it?
Thanks for the help.
-
Nov 27th, 2000, 05:07 PM
#4
A downlevel and/or stripped-down version comes supplied with VB. It can also be purchased from Seagate at http://www.seagatesoftware.com/homepage/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|