473,813 Members | 3,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still changing the data connection fo untyped report

I have following code:

Private Sub SetDataBaseLoca tion(ByVal Report As ReportDocument)
For Each oConnectionInfo As [Shared].IConnectionInf o In
Report.DataSour ceConnections
oConnectionInfo .SetConnection( _Servername, _DatabaseName,
_Username, _Password)
oConnectionInfo .SetLogon(_User name, _Password)
Next

Try
For Each SubReport As ReportDocument In Report.Subrepor ts
SetDataBaseLoca tion(SubReport)
Next
Catch ex As Exception
'Do nothing
End Try
End Sub

Private Sub AuthenticateAcc ess()
'Creates a class in order to store the login info
Dim loConnInfo As New CrystalDecision s.Shared.Connec tionInfo
loConnInfo.Type = ConnectionInfoT ype.Query
loConnInfo.Allo wCustomConnecti on = True
loConnInfo.Serv erName = _Servername
loConnInfo.Data baseName = _DatabaseName
loConnInfo.User ID = _Username
loConnInfo.Pass word = _Password

Dim loTables As CrystalDecision s.CrystalReport s.Engine.Tables
Dim loTable As CrystalDecision s.CrystalReport s.Engine.Table
Dim loTableLogonInf o As CrystalDecision s.Shared.TableL ogOnInfo

'Loops in each table of the report and applies the login
information
For Each loTable In Me.Database.Tab les
loTableLogonInf o = loTable.LogOnIn fo
loTableLogonInf o.ConnectionInf o = loConnInfo
loTable.ApplyLo gOnInfo(loTable LogonInfo)
loTable.Locatio n = _Username & "." &
loTable.Locatio n.Substring(loT able.Location.L astIndexOf(".") + 1)
Next
'End If

For Each Report As ReportDocument In Me.Subreports
AuthenticateAcc ess(Report)
Next

'Search for other subreports in case they were ommited
Dim crSections As Sections = Me.ReportDefini tion.Sections
For Each crSection As Section In crSections
Dim crReportObjects As ReportObjects =
crSection.Repor tObjects
For Each crReportObject As ReportObject In crReportObjects
If crReportObject. Kind =
ReportObjectKin d.SubreportObje ct Then
Dim crSubReportObje ct As SubreportObject =
DirectCast(crRe portObject, SubreportObject )
Dim subRepDoc As ReportDocument =
crSubReportObje ct.OpenSubrepor t(crSubReportOb ject.SubreportN ame)
AuthenticateAcc ess(subRepDoc)
End If
Next
Next
End Sub

These two subs are there to change the data source for an oracle
connection for the report. I have searched in numerous forums and blogs
and knowledge pases about this and everywhere i found that theabove
code is the optimum with exception that it doesn't work.

The report is saved without data. I have two tablespaces that are
completely identical with the exception of the data reiding in their
tables. The company I work in today decided to switch the tablespace
and we found that although we changed all the login credentials for the
old tablespace, supplying the above subs with the credentials of the
new tablespace, the report still connects to the old tablespace.
We tried to change the given credentials to invalid ones, and it gave
as it should a login error.

Now we have the report connecting as user2 but getting data from user1.

Any idea?

Here some system info:
Versions used:

ASP.NET Framework 1 (localhost WinXP SP 2)
Oracle 9i (residing on Linux Red Hat 9 box)
Crystal Reports 10

Dec 20 '05 #1
0 1301

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

Similar topics

0
1734
by: Pushpendra | last post by:
I want to create the crystal report in my VB.net application...the connectivity and creation of dataadapter and dataset is done thru coding...the dataset we get is untyped now how to bind this untyped dataset with crystal report and how the field in my table of dataset can be assign on the crystal report.... If any one can help..... Thanks in advance....
0
1593
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 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.Engine.ReportDocument...
5
7475
by: DraguVaso | last post by:
Hi, Something I don't understand about a Typed DataSet: When a value in the DataSet is DBNull, it throws this error: "Cannot get value because it is DBNull". But aren't Typed DataSets invented to make life easier, to be able to get to tge Tables and Values with less code, in less time? But with this thing you need to add a Try-Catch around every statement when using the value, add for each value a default value in your DataSet (and...
3
4596
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the report has started printing the properties can't be changed. It can be done with an MDB by opening it in design mode hidden, making the change, saving it and then opening it in preview mode. However, this obviously doesn't work in an MDE which...
1
9439
by: sandeepjakhotya | last post by:
Hello All Enyone knows how to change DB Location for the Crystal Report in VB 6. I have created a application in vb 6 and report in crystal report 9.0 The report created is then added to vb programme itself using Add-ins manager into the designers section. Now My programme select for the DB as per user choice at run time and accordingly changes the data enviroment's connection Location but I am anable to change the same with Report At...
0
2540
by: Crash | last post by:
Hello everyone, I need help creating an asp page to view a crystal report, which requires that that I change the database connection dynamically. I thought I had this problem licked in CR7 (the version of crystal the report has been designed in) but when I tried to deploy CR7 to my server I found that I could not install the ASP components on IIS 6.0 (even using the manual installation method). I had a CR9 dev edition update, which came...
5
2440
by: adeel shahid | last post by:
I m using .NET Crystal Report but i have to create report using different servers. right now the connection string is static using store procedure but i want to change the connection string at runtime using the storeprocedure. Can any one help that how can i create a report using a different server address using storeprocedure and dataset. Thanks Adeel Shahid
2
2189
by: hmznzr | last post by:
i am using b.net 2005. i am generating a crystal report. but when i work in a different computer i have to set the location of the database of the report before i generate. is their any dynamic way to set my database location to the report.
7
10115
OuTCasT
by: OuTCasT | last post by:
I know how to change the database and sqlserver for a crystal report Dim report As New ReportDocument Dim connection As IConnectionInfo Dim oldServerName As String = ".\SQLEXPRESS" Dim oldDatabaseName As String = oldDatabaseName Dim newServerName As String = newServerName Dim newDatabaseName As String = newDatabaseName Dim UserID As String = "" Dim Password As String = ""
0
9734
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
10408
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...
1
10426
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
9225
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
6897
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
5570
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
5707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
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
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.