Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Thread Tools Display Modes
  #1 (permalink)  
Old March 18th, 2004, 03:30 PM
Registered User
Join Date: Mar 2004
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old May 11th, 2004, 12:39 PM
Friend of Wrox
Join Date: Jun 2003
Location: Indianapolis, IN, USA.
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts

Are you still having problem with this code?

Wrox Moderator
Reply With Quote
  #3 (permalink)  
Old December 3rd, 2004, 05:41 PM
Registered User
Join Date: Dec 2004
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old February 15th, 2005, 10:36 AM
Registered User
Join Date: Feb 2005
Location: , , .
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)

Reply With Quote

Thread Tools
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
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 11:44 AM
unable to run ch 10 examples jgtez JSP Basics 0 February 24th, 2004 08:22 PM

All times are GMT -4. The time now is 05:55 AM.

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