473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Crystal Reports 10 - How to set Server and DataBase At runtime.

Hi,

I'm trying to set the servername and database for an untyped report at
runtime.
It seems I should do something like the following.

Dim Table As Table
Dim LogonInfo As New TableLogOnInfo
For Each Table In reportDocument.Database.Tables
LogonInfo = Table.LogOnInfo
LogonInfo.ConnectionInfo.ServerName = ConnectString.DataSource
LogonInfo.ConnectionInfo.DatabaseName = ConnectString.InitialCatalog
Table.ApplyLogOnInfo(LogonInfo)
Next

However I get the following error:
:Value of type 'CrystalDecisions.Shared.TableLogOnInfo' cannot be converted
to 'CrystalDecisions.Shared.TableLogOnInfo'.

Can someone point me in the right direction?
TIA Steve
Nov 20 '05 #1
2 8541
Hi Steve,

I think you may take a look at the link below and try to run the steps in
the links to see if the problem persists.
Crystal Report 8.5 for Visual Studio.NET (using C#)
http://www.dotnetforce.com/(kfofub55...aspx?t=a&n=179

When did the problem occur in the runtime or the compile time?

Also which code line pop up the error message, is the line below?
Table.ApplyLogOnInfo(LogonInfo)

I think you may try to change your code as below to see if the problem
persists, becauses the VB.NET is case-insensitive language.
Dim tbl As Table
Dim logInfo As New TableLogOnInfo
For Each Table In reportDocument.Database.Tables
logInfo = tbl.LogOnInfo
logInfo.ConnectionInfo.ServerName = ConnectString.DataSource
logInfo.ConnectionInfo.DatabaseName = ConnectString.InitialCatalog
tbl.ApplyLogOnInfo(LogonInfo)
Next

Also can you check if you are using the same version of crystal reporter
assembly, i.e. if the CrystalDecisions.CrystalReports.Engine.dll is for
.net framework 1.1 and CrystalDecisions.Shared.dll is for .net frameword
1.0 which may cause the problem.

Here is the setting on my machine, you may check them in the object browser
by pressing Ctrl+Alt+J
Assembly CrystalDecisions.Shared
C:\Program Files\Common Files\Crystal
Decisions\1.1\Managed\CrystalDecisions.Shared.dll
Assembly CrystalDecisions.CrystalReports.Engine
C:\Program Files\Common Files\Crystal
Decisions\1.1\Managed\CrystalDecisions.CrystalRepo rts.Engine.dll

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #2
Thanks for a very thoughtful responce Peter.
I'll have a look on Monday and get back to you.

Regards Steve

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:zP**************@cpmsftngxa10.phx.gbl...
Hi Steve,

I think you may take a look at the link below and try to run the steps in
the links to see if the problem persists.
Crystal Report 8.5 for Visual Studio.NET (using C#)
http://www.dotnetforce.com/(kfofub55...aspx?t=a&n=179
When did the problem occur in the runtime or the compile time?

Also which code line pop up the error message, is the line below?
Table.ApplyLogOnInfo(LogonInfo)

I think you may try to change your code as below to see if the problem
persists, becauses the VB.NET is case-insensitive language.
Dim tbl As Table
Dim logInfo As New TableLogOnInfo
For Each Table In reportDocument.Database.Tables
logInfo = tbl.LogOnInfo
logInfo.ConnectionInfo.ServerName = ConnectString.DataSource
logInfo.ConnectionInfo.DatabaseName = ConnectString.InitialCatalog
tbl.ApplyLogOnInfo(LogonInfo)
Next

Also can you check if you are using the same version of crystal reporter
assembly, i.e. if the CrystalDecisions.CrystalReports.Engine.dll is for
net framework 1.1 and CrystalDecisions.Shared.dll is for .net frameword
1.0 which may cause the problem.

Here is the setting on my machine, you may check them in the object browser by pressing Ctrl+Alt+J
Assembly CrystalDecisions.Shared
C:\Program Files\Common Files\Crystal
Decisions\1.1\Managed\CrystalDecisions.Shared.dll
Assembly CrystalDecisions.CrystalReports.Engine
C:\Program Files\Common Files\Crystal
Decisions\1.1\Managed\CrystalDecisions.CrystalRepo rts.Engine.dll

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
4
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I...
0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
7
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at...
7
by: Sink | last post by:
Hi, Looking at reporting tools and was wondering if anyone else has gone thru this. Crystal seems rediculously expensive once you take into account licensing, while Active is runtime-free meaning...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
7
by: John | last post by:
I am using Crystal Reports in my application I made using Visual Studio.NET. I installed my application on the client machine, with all the DLLs required(added the merge modules), the engine and...
0
by: Timmy Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
5
by: Jay | last post by:
I am getting mixed messages from the asp.net website hosting providers - some say they do not support Crystal Reports due to a $25,000 per cpu licensing fee, others say all I need to do is install...
0
by: Crash | last post by:
Windows XP C# .NET 2.0 Crystal Reports v10 I have an application that has 30+ Crystal Reports. Due to bad planning {not by me} the database connection settings are hard coded into each...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.