473,749 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Conne ctionInfo.Serve rName = ConnectString.D ataSource
LogonInfo.Conne ctionInfo.Datab aseName = ConnectString.I nitialCatalog
Table.ApplyLogO nInfo(LogonInfo )
Next

However I get the following error:
:Value of type 'CrystalDecisio ns.Shared.Table LogOnInfo' cannot be converted
to 'CrystalDecisio ns.Shared.Table LogOnInfo'.

Can someone point me in the right direction?
TIA Steve
Nov 20 '05 #1
2 8556
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.ApplyLogO nInfo(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.Connect ionInfo.ServerN ame = ConnectString.D ataSource
logInfo.Connect ionInfo.Databas eName = ConnectString.I nitialCatalog
tbl.ApplyLogOnI nfo(LogonInfo)
Next

Also can you check if you are using the same version of crystal reporter
assembly, i.e. if the CrystalDecision s.CrystalReport s.Engine.dll is for
.net framework 1.1 and CrystalDecision s.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 CrystalDecision s.Shared
C:\Program Files\Common Files\Crystal
Decisions\1.1\M anaged\CrystalD ecisions.Shared .dll
Assembly CrystalDecision s.CrystalReport s.Engine
C:\Program Files\Common Files\Crystal
Decisions\1.1\M anaged\CrystalD ecisions.Crysta lReports.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.m icrosoft.com> wrote in message
news:zP******** ******@cpmsftng xa10.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.ApplyLogO nInfo(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.Connect ionInfo.ServerN ame = ConnectString.D ataSource
logInfo.Connect ionInfo.Databas eName = ConnectString.I nitialCatalog
tbl.ApplyLogOnI nfo(LogonInfo)
Next

Also can you check if you are using the same version of crystal reporter
assembly, i.e. if the CrystalDecision s.CrystalReport s.Engine.dll is for
net framework 1.1 and CrystalDecision s.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 CrystalDecision s.Shared
C:\Program Files\Common Files\Crystal
Decisions\1.1\M anaged\CrystalD ecisions.Shared .dll
Assembly CrystalDecision s.CrystalReport s.Engine
C:\Program Files\Common Files\Crystal
Decisions\1.1\M anaged\CrystalD ecisions.Crysta lReports.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
19180
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 Report at runtime? Example: private void button1_Click(object sender,
4
14287
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 am planning to pass a dataset to the report at runtime. From what I have read, it sounds like unbound fields might be the answer. However, I am having trouble figuring out how to bind these unbound fields to my dataset at runtime.
0
1702
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, or in the code) works fine. However, when I try to add any parameter through the record selection formula and/or the report parameters method, the report crashes. I have tried each of the methods:
7
4030
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 runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
7
3377
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 only developer licenses. On a cost only basis, it seems pretty obvious but what about feature wise. I simply do not have enough time to do a drawn-out analysis and was wondering if anyone else had. Regards
7
5019
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. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
7
4427
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 the rest. When I start my application and, from it, try to open up a report I get an exception "Query engine error: C:\WINDOWS\Temp\temp_*******.rpt" with some wierd numbers instead of *******. Can anyone tell me what the problem is here and how to...
0
1724
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, or in the code) works fine. However, when I try to add any parameter through the record selection formula and/or the report parameters method, the report crashes. I have tried each of the methods:
5
2404
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 Crystal Reports XI (about $500) on a dedicated server and it will run fine. Will Reports developed with the embeded Crystal Reports in VS 2005 run in a Crystal Reports XI environment? -- Thanks
0
1297
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 report. We tried to set database connection information at runtime just before executing the report but that didn't work. I do not have the budget
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9386
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.