Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2005, 07:42 AM
Authorized User
 
Join Date: Mar 2005
Location: , , India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to pritz Send a message via Yahoo to pritz
Default 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



Reply With Quote
  #2 (permalink)  
Old June 29th, 2005, 11:41 PM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old December 25th, 2005, 11:37 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old 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
Default

"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

Reply With Quote
  #5 (permalink)  
Old 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
Default

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

Reply With Quote
  #6 (permalink)  
Old January 20th, 2006, 08:59 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


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
Reply With Quote
  #7 (permalink)  
Old January 20th, 2006, 06:57 PM
Registered User
 
Join Date: Jan 2006
Location: -, -, Philippines.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Marcogol Send a message via Yahoo to Marcogol
Default

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...

Reply With Quote
  #8 (permalink)  
Old January 23rd, 2006, 02:56 AM
Friend of Wrox
Points: 464, Level: 7
Points: 464, Level: 7 Points: 464, Level: 7 Points: 464, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: Colombo, , Sri Lanka.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


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
Reply With Quote
  #9 (permalink)  
Old February 8th, 2006, 03:18 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #10 (permalink)  
Old 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
Send a message via Yahoo to murari
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 wont display crystal Reports 10.0 cnobles VB How-To 2 September 7th, 2014 09:21 AM
About Crystal Report 10 Suhas VB How-To 2 April 9th, 2007 11:27 PM
Vb6 with crystal reports 10 Eleakim Cribe Pro VB 6 0 June 22nd, 2006 09:20 AM
good book for crystal report 10 swati_joshi ASP.NET 1.0 and 1.1 Basics 1 April 20th, 2006 03:09 AM
crystal report 10 santwan Classic ASP Professional 0 December 16th, 2005 05:58 AM



All times are GMT -4. The time now is 11:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.