Wrox Programmer Forums
|
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 June 4th, 2007, 03:30 AM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nishab345
Default data type not coming

For connecting VB6 with Crystal Report 9.

I got some samples codes like below i copied

but when i declare the variable as crystalreport1 its not coming

this line not working
"Dim Report As New CrystalReport1"
please tell me which are the things we need to work this

and please read the below sample codings and and correct it if any mistake is there

thank you for your ongoing support and help

Nishab Kottaram


sample codes :
CrystalReport.rpt
CRViewer91 is the view you design


'VB 6 form
Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
'Report.Database.LogOnServer "P2ssql.dll", "servername", "database", "sa", "password" <---not required
Report.Database.Tables.Item(1).ConnectionPropertie s.Item("password") = "password"

CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Screen.MousePointer = vbDefault

End Sub

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

End Sub


 
Old June 4th, 2007, 03:52 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that line... works fine... with VB 7/8/9 .NET (where you add a physical Report file to the solution and declare an instance of it and make use of it) but not with VB 6. Here you have to create global CR application object and open that report by mentioning its physical path. I guess you are mixing VB6 code and VB.net version code (which are in deifferent for this approach).

Hope this gives you some idea.

With Regards,
Raghavendra Mudugal
 
Old June 5th, 2007, 08:25 AM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nishab345
Default

I am using VB6 and created Report in Seagate Crystal Report9. How i can open a crystalreport when the vb project running mode. Thru which control we can connect the VB6 and Crystal report9 report. pls tell me. i am waiting for your replay


 
Old June 6th, 2007, 03:31 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmmm.... I posted the code in your own thread... here is your thread link link http://p2p.wrox.com/topic.asp?TOPIC_ID=61228

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP page not display data coming from socket ashvinm JSP Basics 0 February 20th, 2008 02:10 AM
data type kfir XML 6 May 7th, 2006 07:15 AM
Which data type should I use? logmaster C# 0 January 2nd, 2006 10:06 AM
Data Type error but it is the correct type Mitch SQL Server 2000 2 March 19th, 2004 11:31 AM





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