Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 6th, 2003, 04:32 AM
Registered User
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal reports 9.0 with Visual Basic 6.0

Is there any crystal reports control to call the reports file from vb, like we have it in Crystal Reports 7 and 8.

Else what is the way I can open a Crystal Reports 9.0 file in VB ???
Old December 8th, 2004, 06:22 PM
Registered User
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

This is what I do using Crystal Reports 9 with VB6

When creating an ActiveX Designer Report (DSR), the Crystal Reports
Gallery dialog appears. Choose From an Existing Report and browse to
the report file. The Report file will be converted to a DSR for use with the RDC in Visual Basic.

The wizard does the rest.

Then enter your code as normal.


Because your finished exe may end up being large / more functionality

Add a Form
Insert controls - CommonDialog1 - CRViewer91

Dim lApplication As CRAXDRT.Application
Dim lReport As CRAXDRT.Report

Private Sub mnuFileOpen_Click()
Dim strRpt As String
Dim Report
                                                                            'Set filters for the Open dialog to choose only a RPT file
    CommonDialog1.Filter = "Report (*.rpt)|*.rpt"
                                                                           'Set the filename selected to the string variable
    strRpt = CommonDialog1.FileName
Set lApplication = New CRAXDDRT.Application
Set lReport = lApplication.OpenReport(strRpt) ' Open the report
    CRViewer91.ReportSource = lReport

Exit Sub
    MsgBox Err.Description & " " & Err.Number
End Sub

Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.height = ScaleHeight
CRViewer91.Width = ScaleWidth
End Sub

Hope this helps.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrating Crystal Reports 10 in Visual Basic 6 vava2300 VB Components 2 December 28th, 2006 09:57 AM
Visual Basic 5.0 using Crystal Reports JMCHAP1 Beginning VB 6 0 August 21st, 2006 10:38 AM
Crystal Reports and Visual Basic 6 Diego2 VB How-To 0 January 13th, 2005 06:52 PM
Crystal Reports Enterprise 10 and Visual Basic 6.0 rbdeveloper BOOK: Professional Crystal Reports for VS.NET 0 October 19th, 2004 11:08 AM
crystal reports 8.0 in visual basic 5.0 reachshalini VB Components 1 September 30th, 2004 08:18 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.