|
 |
VB How-To Ask your "How do I do this with VB?" questions in this forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |
|

June 10th, 2005, 07:42 AM
|
Authorized User
|
|
Join Date: Mar 2005
Location: , , India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
VB6 with crystal report 10
Hi Friends,
i m new to do this ...how could i call my crystal report 10 in vb6?
plz give some information regarding which component and references
is to be added in vb6 to make crystal report working?
i would be thankful for your affords.
Regards,
Pritz
|

June 29th, 2005, 11:41 PM
|
Friend of Wrox
|
|
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello
For Calling the .rpt file in vb6, make a reference
of the control Crystl32.ocx "Crystal Report Control"
You will find a control in the toolbox, add that control into the form.
You can use the control's methods and properties
to set the file name of that .rpt file and set
the action property to "1".
It will show the report.
Hope this helps.
With Regards,
Raghavendra Mudugal
|

December 25th, 2005, 11:37 AM
|
Registered User
|
|
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You Can Use the following code after adding the component : Crystal ActiveX Report Viewer Library 10.0
-----------
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport("d:\Report3.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
----------
where CRViewer1 is the name of the added component to your project
|

December 28th, 2005, 04:27 PM
|
Registered User
|
|
Join Date: Dec 2005
Location: Thrissur, Kerala, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
"Crystal Report Control" (Crystl32.ocx) is not available from Crystal reports 9 onwards. so the
posting by Raghavendra Mudugal dosent work. The second posting is OK and is the best method
|

January 20th, 2006, 07:18 AM
|
Registered User
|
|
Join Date: Jan 2006
Location: Nagpur, Maharashtra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello friends
When i used the following code to run the crystal report.
error message displayed "User defined Type not defined".
Wht is this CRAXDRT i can not use it in my VB6 from.
If anybody can help me....
Quote:
quote:Originally posted by ahmed_hammam70
You Can Use the following code after adding the component : Crystal ActiveX Report Viewer Library 10.0
-----------
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport("d:\Report3.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
----------
where CRViewer1 is the name of the added component to your project
|
|

January 20th, 2006, 08:59 AM
|
Friend of Wrox
|
|
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi pritz,
There are 2 ways to display a crystal report. You can use DSR(Crystal report designer) or external reports. Since you are new to this use the second method.
Create your crystal report and include it in a folder in your application path.Then you can call it in your VB form. Add a crystal report control on your form then assign the report file name/window state/selection formula(if needed) and action(1=to display the report)
Let us know if you need more help or sample code regarding this.
nalaka hewage
|

January 20th, 2006, 06:57 PM
|
Registered User
|
|
Join Date: Jan 2006
Location: -, -, Philippines.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
sorry for the bump but i cant get how to get this work...
how do i call the report from my folder and how do i print preview it before printing?? please help me... this is due in a few hours...
|

January 23rd, 2006, 02:56 AM
|
Friend of Wrox
|
|
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Marcogol,
Follow these steps and tell me where you fail? (if needed)
(1) Create the report using crystal reports inside a folder called reports in your application path. Make sure your report is working properly without any bugs. (you can do this by refreshing report's data)
(2) Add a crystal report contrroller on your vb form. (if you can't see crystal report control in your tollbox, go to Project-->Components-->Crystal Report Control to add crystal report control to your toolbox)
(3) In your vb code,
Private Sub cmdPrint_Click()
' Assign report name
CrystalReport1.ReportFileName=App.Path & "\Report1.rpt"
' command to display the report
CrystalReport1.Action=1
' Set window state and other properties laso
End Sub
* Note: CrystalReport1 - Crystal report control name
Report1.rpt - crystal report name which contain in reports folder
nalaka hewage
|

February 8th, 2006, 03:18 PM
|
Registered User
|
|
Join Date: Feb 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Please let me know if anyone gets a good solid answer for this. Nothing above works with version 10. Works with older versions but not 10. Thanks for your help
|

April 23rd, 2006, 08:09 PM
|
Registered User
|
|
Join Date: Apr 2006
Location: Cochin, Kerala, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by ahmed_hammam70
You Can Use the following code after adding the component : Crystal ActiveX Report Viewer Library 10.0
-----------
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport("d:\Report3.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
----------
where CRViewer1 is the name of the added component to your project
|
Dear ahmed_hammam70,
I am in the look out of a solution of previewing and printing a report created in crystal report 8x through VB6. I was directed to this forum link and with the help of your code, I could preview the report. But I could not get the same printed even if I change the "CRViewer1 propoerty to print report. Can you help me ?
with regards
Murari
Murari
murariraghavan@yahoo.co.in
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |