473,385 Members | 1,912 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,385 software developers and data experts.

Untyped Crystal report database connection Info

We are trying to use untyped reports in a C# application. Since the reports
are being written by a third party the connection information needs changed
at runtime. It will always be a ODBC SQL server database. I tried using a
function from Chapter17 of Brian Bischof's book "Crystal Reports .NET
Programming", however it does not work.

What am I missing?

private void
LogonToDatabase(CrystalDecisions.CrystalReports.En gine.ReportDocument report,
string serverName, string databaseName, string userId, string password)
{
CrystalDecisions.Shared.ConnectionInfo connectionInfo = new
CrystalDecisions.Shared.ConnectionInfo();

connectionInfo.ServerName = serverName;
connectionInfo.DatabaseName = databaseName;
connectionInfo.UserID = userId;
connectionInfo.Password = password;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in
report.Database.Tables)
{
CrystalDecisions.Shared.TableLogOnInfo logonInfo = table.LogOnInfo;
logonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(logonInfo);

if (table.Location != table.Name)
{
table.Location = table.Name;
}
}
}
Jul 21 '05 #1
0 1561

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

Similar topics

1
by: codepuller | last post by:
Consider this approach: Embed the report in your project (add it to the project) Then put this code in the page that holds the viewer control 'Set the connection information...
3
by: Deasun | last post by:
I need some help please! Crystal is driving me nuts. Heres my code so far, see below. Problem: On the .export() line it comes back with error #5 Login failed! I know the login info is good so...
7
by: Bernie Yaeger | last post by:
I can't believe that there aren't lots of developers who: 1. create a crystal report that connects to sql server 2. calls the report using the crystalreportviewer control to view it and then,...
5
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. According to article...
7
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application via VS 2003 that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. I'm trying to change...
1
by: cantonarv | last post by:
Just trying to do a basic crystal report and viewing it with dynamic sql server database but dont no what i'm doing wrong? I am using integrated security. Dim myRpt As crpt1 = New crpt1 ...
0
by: Stedak | last post by:
We are trying to use untyped reports in a C# application. Since the reports are being written by a third party the connection information needs changed at runtime. It will always be a ODBC SQL...
0
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a...
0
by: khairihusseini | last post by:
I have following code: Private Sub SetDataBaseLocation(ByVal Report As ReportDocument) For Each oConnectionInfo As .IConnectionInfo In Report.DataSourceConnections...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.