Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports 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 28th, 2004, 01:47 AM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting Crystal Report Server & Database

I am using crystal report in vb.net. i have build the crystal report ItemList.rpt. while design mode i have select SQL Server "ABC" as provider for the report and MYDatabase1 as source for he report. I have designed the report and if run through application, it works fine. Now I want to change the server name & database name for this crystal report file. for this i have used following code ..

Dim LogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo()
Dim connectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
Dim table As CrystalDecisions.CrystalReports.Engine.Table
Dim sItemList as new rptItemList ' this is report file instance

For Each table In sItemList.Database.Tables
     LogOnInfo = table.LogOnInfo
     ' Set the server or ODBC data source name, database name,
     ' user ID, and password.
     LogOnInfo.ConnectionInfo.ServerName = "XYZ"
     LogOnInfo.ConnectionInfo.DatabaseName = "NewDatabase"
     LogOnInfo.ConnectionInfo.UserID = "sa"
     LogOnInfo.ConnectionInfo.Password = ""
     ' Apply the connection information to the table.
     table.ApplyLogOnInfo(LogOnInfo)
Next table
sItemList.Refresh()
cr1.ReportSource = sItemList

After this if I check the logon info as ServerName, Database is changed to the newly assigned values, but the item list is shown from the ABC Servber's MyDatabase (from Database at design time.)

Can u solve this problem or suggest another method to perform this task please inform me [email protected]


Maheshkumar Jadhav
 
Old June 29th, 2004, 12:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Plz take a look at http://p2p.wrox.com/topic.asp?TOPIC_ID=6389

What is that Refresh for?!

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report & VB6 & SQL Server wlho VB How-To 2 June 5th, 2013 01:58 AM
Chapter 15 15_1 & 15_2 and setting up SQL server a3321889495 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 13th, 2006 06:19 AM
Setting up & Connecting to SQL Server Scripts82 SQL Server 2000 1 March 9th, 2006 06:16 AM
Setting up stored procedure for Crystal Report.... potato3 SQL Language 1 December 9th, 2004 12:33 PM
Setting path to local "C" drive for crystal report rajupusapati Crystal Reports 2 June 17th, 2004 11:47 AM





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