473,785 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,datab ase,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 4439
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLo cations(ByRef rpt As ReportDocument)
Dim crConnectionInf o As New ConnectionInfo
With crConnectionInf o
'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 = LogonUserPasswo rd
End With

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

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

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

For Each crtable In crTables
crTableLogOnInf o = crtable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crtable.ApplyLo gOnInfo(crTable LogOnInfo)
If crtable.TestCon nectivity() Then
' Create fully qualified name by
appending "database.owner ." to the table name.
crtable.Locatio n = DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1)
Else
MessageBox.Show ("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 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,datab ase,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 SetDatabaseLogo n do then? the way MSDN puts it, it sounds
like it should change the database...
"Lee Moody" <an*******@disc ussions.microso ft.com> wrote in message
news:1d******** *************** ******@phx.gbl. ..
The following is some code provided to me from Crystal
Reports that may help:

Sub SetReportFileLo cations(ByRef rpt As ReportDocument)
Dim crConnectionInf o As New ConnectionInfo
With crConnectionInf o
'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 = LogonUserPasswo rd
End With

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

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

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

For Each crtable In crTables
crTableLogOnInf o = crtable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crtable.ApplyLo gOnInfo(crTable LogOnInfo)
If crtable.TestCon nectivity() Then
' Create fully qualified name by
appending "database.owner ." to the table name.
crtable.Locatio n = DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1)
Else
MessageBox.Show ("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 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,datab ase,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 SetDatabaseLogo n does.

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

Sub SetReportFileLo cations(ByRef rpt As ReportDocument)
Dim crConnectionInf o As New ConnectionInfo
With crConnectionInf o
'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 = LogonUserPasswo rd
End With

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

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

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

For Each crtable In crTables
crTableLogOnInf o = crtable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crtable.ApplyLo gOnInfo(crTable LogOnInfo)
If crtable.TestCon nectivity() Then
' Create fully qualified name by
appending "database.owner ." to the table name.
crtable.Locatio n = DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1)
Else
MessageBox.Show ("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 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,datab ase,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*******@disc ussions.microso ft.com> wrote in message
news:1d******** *************** ******@phx.gbl. ..
I have no idea what SetDatabaseLogo n does.

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

puts it, it sounds
like it should change the database...
"Lee Moody" <an*******@disc ussions.microso ft.com> wrote

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

Sub SetReportFileLo cations(ByRef rpt As ReportDocument)
Dim crConnectionInf o As New ConnectionInfo
With crConnectionInf o
'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 = LogonUserPasswo rd
End With

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

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

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

For Each crtable In crTables
crTableLogOnInf o = crtable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crtable.ApplyLo gOnInfo(crTable LogOnInfo)
If crtable.TestCon nectivity() Then
' Create fully qualified name by
appending "database.owner ." to the table name.
crtable.Locatio n = DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1)
Else
MessageBox.Show ("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 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,datab ase,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
15179
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 designer it shows up very fast. When the report is printed from my application it takes about ten times as long to get the report to appear. When printing straight from the Crystal Reports
3
6917
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
5025
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...
19
3882
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 ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
7
4430
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...
2
3564
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 being the case I worked with what was available: I used vb.net and crystal 8.5. The crystal reports are being viewed in the crystal report viewer which is still included in vb.net. I went ahead with developing this project because I found that...
17
8452
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 using crystal reports 9 and vb.net and we're using the crystalrepotViewer to show our reports. But every time we open a report the connection to or sql server remains, so if I open 5 forms with the report viewer I've got 5 sleeping connections in...
1
4318
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 ExcelUseConstantColumnWidth = False. On my PC when exporting a report, it works - columns are varible width to fit the field, from the server it does not - I get constant width columns. I suspect it is a DLL issue, but so far all my comparisons are coming out the same.
2
8690
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 .rpt (on the file system) to the control's ".ReportSource" property. i do this because i like to move new versions of the reports w/o having to rebuild the site. then i pass in filter criteria to the control's ".SelectionFormula"
1
2311
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 working fine, but some pages which contains CrystalReportViewer are not working and i got an Exception which is given below. "An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key...
0
9645
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
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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
8973
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
5381
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...
1
4053
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
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.