Wrox Programmer Forums
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET 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 March 18th, 2004, 04:30 PM
Registered User
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 3 Examples Don't Work

I am trying to run the examples in Chapter 3. The example "viewer_ database" runs but prompts you for login information despite having login information in code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim myReport = New ch3_worldsales_northwind()
   Dim myTableLogonInfos = New CrystalDecisions.Shared.TableLogOnInfos()
   Dim myTableLogonInfo = New CrystalDecisions.Shared.TableLogOnInfo()
   Dim myConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()
   With myConnectionInfo
     .ServerName = "localhost"
     .DatabaseName = "Northwind"
     .UserID = "sa"
     .Password = ""
   End With

   myTableLogonInfo.ConnectionInfo = myConnectionInfo
   myTableLogonInfo.TableName = "customers"
   CrystalReportViewer1.LogOnInfo = myTableLogonInfos
   CrystalReportViewer1.ReportSource = myReport
End Sub

Does anybody have a fix for this?

Any help is greatly appreciated.

Old May 11th, 2004, 12:39 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts

Are you still having problem with this code?

Wrox Moderator
Old December 3rd, 2004, 06:41 PM
Registered User
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

adding the following line after the with...end with:
MyReport.Database.Tables(0).ApplyLogOnInfo(myTable LogonInfo)

For me that alone did not provide the complete solution. I went to the report that was added to the project (ch3_worldsales_northwind.rpt) and opened it up. Then right click any where on the report, select database, select 'set database location' and pointed it to the copy in c:\program files\microsoft office\office\samples\northwind.mdb and clicked update. I also did a verify database (right click, database, verify database). This is what worked for me. Hope it helps some one else

Old February 15th, 2005, 11:36 AM
Registered User
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Please not that there is an error in code (and in the ch3 report...):
The correct line in code is:
myTableLogonInfo.TableName = "Customer"

(correct table name in the ch3_worldsales_northwind.rpt report, even if the real name of the table, in Northwind, is Customers...)

and not
myTableLogonInfo.TableName = "customers"

Please not that you have to use C (Uppercase)

Similar Threads
Thread Thread Starter Forum Replies Last Post
How ch. 11 examples return false for ctrlKey? horseatingweeds BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 March 18th, 2008 12:01 AM
db2 doesn't work as a db for RoR examples rafmathijs BOOK: Beginning Ruby on Rails 0 August 30th, 2007 03:50 AM
Recommended setup to work thru the examples? kjullion BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 February 13th, 2006 12:44 PM
unable to run ch 10 examples jgtez JSP Basics 0 February 24th, 2004 09:22 PM

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