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 December 8th, 2004, 08:44 AM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal Report-Database change

Hi,

I have just started working with CR, I am using CR 10.
I created a report which is referrefing a AAA database, I want to change these references to BBB database which has the same data than AAA but different name columns.
I am using ODBC-System DSN, and when I try to change from AAA to BBB, I am configuring SetDatasourcelocation, unsuccessfully.:(

 
Old December 30th, 2004, 08:22 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ahmedfathey Send a message via Yahoo to ahmedfathey
Default

Private Function SetDataSource _
(ByVal conn As String, ByVal query As String, _
ByVal dataSet As DataSet)

   ' Use ADO.NET object model to set up the connection
   ' information.
   Dim oleConn As New OleDbConnection(conn)
   Dim oleAdapter As New OleDbDataAdapter()
   oleAdapter.SelectCommand = New OleDbCommand(query, oleConn)

   ' Connect to the data source, fetch the data, and disconnect
   ' from the database.
   oleAdapter.Fill(dataSet, "Customer")

   ' Pass the populated data set to the report.
   Report.SetDataSource(dataSet)
End Function


 
Old December 30th, 2004, 08:23 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ahmedfathey Send a message via Yahoo to ahmedfathey
Default

[C#]
private void SetDataSource
(string conn, string query, DataSet dataSet)
{
   // Use ADO.NET object model to set up the connection
   // information.
   OleDbConnection oleConn = new OleDbConnection(conn);
   OleDbDataAdapter oleAdapter = new OleDbDataAdapter();
   oleAdapter.SelectCommand = new OleDbCommand(query, oleConn);

   // Connect to the data source, fetch the data, and disconnect
   // from the database.
   oleAdapter.Fill(dataSet, "Customer");

   // Pass the populated data set to the report.
   Report.SetDataSource (dataSet);
}







Similar Threads
Thread Thread Starter Forum Replies Last Post
Change datasource of crystal report at runtime check123 Pro VB 6 1 March 21st, 2008 05:45 AM
how to change crystal report server from vb anupama Pro VB 6 5 March 28th, 2007 10:49 AM
change Datasource of a crystal report at run time tiyyob Pro VB 6 1 February 17th, 2007 06:05 AM
Change Crystal Report Viewer header matrix_evo Crystal Reports 0 July 18th, 2006 04:00 AM
How to change server in Crystal Report from VB pavel Pro VB 6 0 October 23rd, 2003 08:41 AM





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