Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases 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 January 14th, 2004, 04:43 PM
Registered User
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default vb 6 and crystal reports problem

I'm having a problem with my data displaying or being read. I'm not sure because i don't get any run time error.
What I do is create report (.rpt) file using a data definition file (.ttx). I create my report with crystal report for peachtree software and save it to my visual basic 6 project directory. After I fill the dataset in my program intialize the crystal report objects (Application, Report) and give the report object to the viewer's. The report is saved as GeneralJournal.rpt.
'initialize objects contained in a module

Global GeneralJournal As ADODB.Recordset
Global CRApplication As CRAXDRT.Application
Global CRReport As CRAXDRT.Report

'create initialize report

reports source (in code below):
        Set CRApplication = New CRAXDRT.Application
        Set CRReport = CRApplication.OpenReport("GeneralJournal.rpt")
        CRReport.Database.Tables(1).SetDataSource GeneralJournal, 3
        CRViewer1.ReportSource = CRReport

-----------------------end of code-------------------
I am 100 percent sure the recordset actually contains data before it is given to the datasource. Nothing is being displayed on my report except for the example data from the ttx file
Old January 15th, 2004, 05:42 AM
Authorized User
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts

The only difference from the way I use is this

 CRReport.Database.SetDataSource gRst, 3, 1

Don't know if this helps. I got it from CR Support a while back

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports 11 from VB to VB.net koushik_b2002 Crystal Reports 2 June 1st, 2008 01:58 AM
VB 6.0 with Crystal Reports XI jmss66 VB Components 1 August 9th, 2006 02:55 PM
connectivity problem with crystal reports & vb rni Crystal Reports 0 April 19th, 2006 03:29 AM
vb crystal reports please help! abbeyignacio@yahoo.com Forum and Wrox.com Feedback 0 August 31st, 2005 06:54 AM
VB and Crystal Reports googly21_99 VB Components 0 September 18th, 2003 09:25 AM

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