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

Crystal Reports problem

I have a bunch of reports in crystal reports.net, i need to basicly run them
on differnt databases depending on which one the user logged into at the
vb.net application start (dev, live, testing)... now the reports are created
at the development level.. so i figured just change the database like you
pass parameters to the report viewer... well.. I cant seem to figure that
one out, but the report alone as an object (ReportDocument object) has a
method SetDataSource which lets you specify the user,pass,database,server
name per report... now my questions are

1) instead of at the report level can i do this at the report viewer level
somehow?

2) how do i use windows authentication with this? it seems to support
user/pass only.. thanks
Nov 20 '05 #1
4 4417
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLocations(ByRef rpt As ReportDocument)
Dim crConnectionInfo As New ConnectionInfo
With crConnectionInfo
'physical server name (OLE DB) or ODBC DSN
.ServerName = DNSName
' Note: you do not need to set .DatabaseName for
Oracle.
.DatabaseName = DatabaseName
.UserID = LogonUserName
.Password = LogonUserPassword
End With

'Get the table information from the report
Dim crDatabase As Database
crDatabase = rpt.Database

Dim crTables As Tables
crTables = crDatabase.Tables
Dim crtable As Table

'Loop through all tables in the report and apply the
connection
'information for each table.
Dim crTableLogOnInfo As TableLogOnInfo

For Each crtable In crTables
crTableLogOnInfo = crtable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crtable.ApplyLogOnInfo(crTableLogOnInfo)
If crtable.TestConnectivity() Then
' Create fully qualified name by
appending "database.owner." to the table name.
crtable.Location = DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1)
Else
MessageBox.Show("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1))
End If
Next
End Sub

-Lee
-----Original Message-----
I have a bunch of reports in crystal reports.net, i need to basicly run themon differnt databases depending on which one the user logged into at thevb.net application start (dev, live, testing)... now the reports are createdat the development level.. so i figured just change the database like youpass parameters to the report viewer... well.. I cant seem to figure thatone out, but the report alone as an object (ReportDocument object) has amethod SetDataSource which lets you specify the user,pass,database,servername per report... now my questions are

1) instead of at the report level can i do this at the report viewer levelsomehow?

2) how do i use windows authentication with this? it seems to supportuser/pass only.. thanks
.

Nov 20 '05 #2
ok but what does SetDatabaseLogon do then? the way MSDN puts it, it sounds
like it should change the database...
"Lee Moody" <an*******@discussions.microsoft.com> wrote in message
news:1d*****************************@phx.gbl...
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLocations(ByRef rpt As ReportDocument)
Dim crConnectionInfo As New ConnectionInfo
With crConnectionInfo
'physical server name (OLE DB) or ODBC DSN
.ServerName = DNSName
' Note: you do not need to set .DatabaseName for
Oracle.
.DatabaseName = DatabaseName
.UserID = LogonUserName
.Password = LogonUserPassword
End With

'Get the table information from the report
Dim crDatabase As Database
crDatabase = rpt.Database

Dim crTables As Tables
crTables = crDatabase.Tables
Dim crtable As Table

'Loop through all tables in the report and apply the
connection
'information for each table.
Dim crTableLogOnInfo As TableLogOnInfo

For Each crtable In crTables
crTableLogOnInfo = crtable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crtable.ApplyLogOnInfo(crTableLogOnInfo)
If crtable.TestConnectivity() Then
' Create fully qualified name by
appending "database.owner." to the table name.
crtable.Location = DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1)
Else
MessageBox.Show("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1))
End If
Next
End Sub

-Lee
-----Original Message-----
I have a bunch of reports in crystal reports.net, i need

to basicly run them
on differnt databases depending on which one the user

logged into at the
vb.net application start (dev, live, testing)... now the

reports are created
at the development level.. so i figured just change the

database like you
pass parameters to the report viewer... well.. I cant

seem to figure that
one out, but the report alone as an object

(ReportDocument object) has a
method SetDataSource which lets you specify the

user,pass,database,server
name per report... now my questions are

1) instead of at the report level can i do this at the

report viewer level
somehow?

2) how do i use windows authentication with this? it

seems to support
user/pass only.. thanks
.

Nov 20 '05 #3
I have no idea what SetDatabaseLogon does.

-Lee
-----Original Message-----
ok but what does SetDatabaseLogon do then? the way MSDN puts it, it soundslike it should change the database...
"Lee Moody" <an*******@discussions.microsoft.com> wrote in messagenews:1d*****************************@phx.gbl...
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLocations(ByRef rpt As ReportDocument)
Dim crConnectionInfo As New ConnectionInfo
With crConnectionInfo
'physical server name (OLE DB) or ODBC DSN
.ServerName = DNSName
' Note: you do not need to set .DatabaseName for
Oracle.
.DatabaseName = DatabaseName
.UserID = LogonUserName
.Password = LogonUserPassword
End With

'Get the table information from the report
Dim crDatabase As Database
crDatabase = rpt.Database

Dim crTables As Tables
crTables = crDatabase.Tables
Dim crtable As Table

'Loop through all tables in the report and apply the
connection
'information for each table.
Dim crTableLogOnInfo As TableLogOnInfo

For Each crtable In crTables
crTableLogOnInfo = crtable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crtable.ApplyLogOnInfo(crTableLogOnInfo)
If crtable.TestConnectivity() Then
' Create fully qualified name by
appending "database.owner." to the table name.
crtable.Location = DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1)
Else
MessageBox.Show("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1))
End If
Next
End Sub

-Lee
>-----Original Message-----
>I have a bunch of reports in crystal reports.net, i
need to basicly run them
>on differnt databases depending on which one the user

logged into at the
>vb.net application start (dev, live, testing)... now
the reports are created
>at the development level.. so i figured just change the

database like you
>pass parameters to the report viewer... well.. I cant

seem to figure that
>one out, but the report alone as an object

(ReportDocument object) has a
>method SetDataSource which lets you specify the

user,pass,database,server
>name per report... now my questions are
>
>1) instead of at the report level can i do this at the

report viewer level
>somehow?
>
>2) how do i use windows authentication with this? it

seems to support
>user/pass only.. thanks
>
>
>.
>

.

Nov 20 '05 #4
doesnt look like it does much from my testing :)
"Lee Moody" <an*******@discussions.microsoft.com> wrote in message
news:1d*****************************@phx.gbl...
I have no idea what SetDatabaseLogon does.

-Lee
-----Original Message-----
ok but what does SetDatabaseLogon do then? the way MSDN

puts it, it sounds
like it should change the database...
"Lee Moody" <an*******@discussions.microsoft.com> wrote

in message
news:1d*****************************@phx.gbl...
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLocations(ByRef rpt As ReportDocument)
Dim crConnectionInfo As New ConnectionInfo
With crConnectionInfo
'physical server name (OLE DB) or ODBC DSN
.ServerName = DNSName
' Note: you do not need to set .DatabaseName for
Oracle.
.DatabaseName = DatabaseName
.UserID = LogonUserName
.Password = LogonUserPassword
End With

'Get the table information from the report
Dim crDatabase As Database
crDatabase = rpt.Database

Dim crTables As Tables
crTables = crDatabase.Tables
Dim crtable As Table

'Loop through all tables in the report and apply the
connection
'information for each table.
Dim crTableLogOnInfo As TableLogOnInfo

For Each crtable In crTables
crTableLogOnInfo = crtable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crtable.ApplyLogOnInfo(crTableLogOnInfo)
If crtable.TestConnectivity() Then
' Create fully qualified name by
appending "database.owner." to the table name.
crtable.Location = DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1)
Else
MessageBox.Show("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Location.Substring(crtable.Location.LastIn dexOf
(".") + 1))
End If
Next
End Sub

-Lee

>-----Original Message-----
>I have a bunch of reports in crystal reports.net, i need to basicly run them
>on differnt databases depending on which one the user
logged into at the
>vb.net application start (dev, live, testing)... now the reports are created
>at the development level.. so i figured just change the
database like you
>pass parameters to the report viewer... well.. I cant
seem to figure that
>one out, but the report alone as an object
(ReportDocument object) has a
>method SetDataSource which lets you specify the
user,pass,database,server
>name per report... now my questions are
>
>1) instead of at the report level can i do this at the
report viewer level
>somehow?
>
>2) how do i use windows authentication with this? it
seems to support
>user/pass only.. thanks
>
>
>.
>

.

Nov 20 '05 #5

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

Similar topics

13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
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....
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
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...
2
by: fig000 | last post by:
Hi everyone, I recently wrote a vb.net app which includes some crystal reports. The user has very little money in their budget and have been without a working application for quite a while. This...
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
2
by: matt | last post by:
hello, i have an .RPT file that i am using to load a report via the ASP.NET CrystalReportViewer control. i dont include my .RPTs as embedded resources...instead i load the absolute path of the...
1
by: appandairajc | last post by:
Hi Friends, I have a problem in Crystal Reports. I have a web application and it was published in machine. I am running that application through a virtual path. All the pages are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
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
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,...
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...

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.