|
-
Jan 16th, 2008, 10:18 AM
#1
New Member
Re: Crystal Reports XI with Visual Basic 6.0
If you wish to create an application that allows the user to view an existing crystal report then this is what you do:
Make sure you have crystal report designer installed first. This will install all the required component for our application.
Then proceede to Visual Studio and open VB 6.
1. First create a vb project ( standard exe or ocx)
2. You will be displayed with a blank form.
3. Go to Project > Components
4. Select "Crystal Activex Report Viewer Library 11.0" and Click ok. A new icon should appear in the toolbar.
5. Then go to Project > References
6. and select "Crystal Report Activex Designer Runtime Library 11.0"
7. On the Blank Form drag a crystal report viewer from the toolbar. Name it "crsv1"
8. Then type the following code:
Code:
'***************************************************************************************
'* This project uses the following reference for the CRAXDRT object
'* Crystal Report Activex Designer Runtime Library 11.0
'***************************************************************************************
Private Sub Form_Load()
Dim Report As New CRAXDRT.Application
setViewerSize
crsv1.ReportSource = Report.OpenReport("C:\crystal_reports\repor1.rpt")
crsv1.ViewReport
End Sub
Private Sub form_resize()
setViewerSize
End Sub
Private Sub setViewerSize()
crsv1.Width = Form1.Width - 100
crsv1.Height = Form1.Height - 400
End Sub
Well thats it. if you have any question send me an email
thanks
Shah Chandon
Last edited by skchandon; Jan 16th, 2008 at 10:22 AM.
-
Jan 24th, 2008, 01:15 PM
#2
New Member
Re: Crystal Reports XI with Visual Basic 6.0
Chandon,
I tried the steps you have posted. When I ran the code it gave me the following error
Dim Report As New CRAXDRT.Application "Compile error - user defined type not defined"
How do I fix that?
We have 25 reports in Crystal 11. Database is Oracle 10g. We are using VB 6.0 as the front end to run the crystal reports and logonto the Oracle database.
Thanks,
Saloni
-
Apr 25th, 2012, 10:23 AM
#3
New Member
Re: Crystal Reports XI with Visual Basic 6.0
 Originally Posted by skchandon
If you wish to create an application that allows the user to view an existing crystal report then this is what you do:
Make sure you have crystal report designer installed first. This will install all the required component for our application.
Then proceede to Visual Studio and open VB 6.
1. First create a vb project ( standard exe or ocx)
2. You will be displayed with a blank form.
3. Go to Project > Components
4. Select " Crystal Activex Report Viewer Library 11.0" and Click ok. A new icon should appear in the toolbar.
5. Then go to Project > References
6. and select " Crystal Report Activex Designer Runtime Library 11.0"
7. On the Blank Form drag a crystal report viewer from the toolbar. Name it " crsv1"
8. Then type the following code:
Code:
'***************************************************************************************
'* This project uses the following reference for the CRAXDRT object
'* Crystal Report Activex Designer Runtime Library 11.0
'***************************************************************************************
Private Sub Form_Load()
Dim Report As New CRAXDRT.Application
setViewerSize
crsv1.ReportSource = Report.OpenReport("C:\crystal_reports\repor1.rpt")
crsv1.ViewReport
End Sub
Private Sub form_resize()
setViewerSize
End Sub
Private Sub setViewerSize()
crsv1.Width = Form1.Width - 100
crsv1.Height = Form1.Height - 400
End Sub
Well thats it. if you have any question send me an email
thanks
Shah Chandon
Hi Chandon,
I used the above code you posted and i am getting Logon Failed error.
Do i need to include any more information regarding login details.
Thanks in advance
Rahul
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
|