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

Crystal Reports for .NET and Oracle problem - Logon failed

Hi wise people,
Has anyone encountered the Crystal Reports problem I describe below?
If so, how did you solve it? It seems that every article posted on
google regarding CR and logon problems is still unanswered. I think
I'm cursed.

I originally created a crystal report which connects to a sql server
server db on the same dev machine and it worked just fine. I tried to
move it to another computer, but now I have to connect to an Oracle
database which resides on another server. So, I created a DSN called
myDSN, and changed my report to use the new DSN. I made sure that I
set the database name to "" (empty string) as specified by the Crystal
Support website: see
Unfortunately I keep getting a logon failure.
Any ideas about this problem?
I appreciate your help.

Here is my code:
'=========================BEGIN WEB FORM CODE ===============
Imports System.Data
Imports Microsoft.ApplicationBlocks.Data
Imports Microsoft.ApplicationBlocks.ExceptionManagement
Imports System.Data.OracleClient
Imports System.Text

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class rptSSCrystal
Inherits mywebapp.BaseReport
Protected WithEvents CrystalReportViewer1 As

Private oRpt As rptTestCR = New rptTestCR()
Private mStartDate As String = "14-01-2004 07:00:00" 'Oracle
Private mEndDate As String = "15-01-2004 07:00:00" 'Oracle

#Region "SQL Statements"
Dim mstrSQL As String = "SELECT datetime, department, reason,
oper_comment " _
& "FROM Table1 "

#End Region

#Region "Public properties"
Private Property StartDate()
Return mStartDate
End Get
Set(ByVal Value)
mStartDate = Value
End Set
End Property
Private Property EndDate()
Return mEndDate
End Get
Set(ByVal Value)
mEndDate = Value
End Set
End Property
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim ds As DataSet = New DataSet

'Add the where clause to the sql statement
mstrSQL += " WHERE datetime >= to_date('" & Me.StartDate &
"','DD-MM-YYYY HH24:MI:SS')" & " AND datetime <= to_date('" &
Me.EndDate & "','DD-MM-YYYY HH24:MI:SS')" & " ORDER BY datetime DESC"

'Get the dataset
ds = OracleHelper.ExecuteDataset(Me.ConnectionString,
CommandType.Text, mstrSQL)

'Use Report Engine object model to pass populated
' to report

'Set permissions
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
Dim TableCounter

With crConnectionInfo
.ServerName = "myDSN"

'If you are connecting to Oracle there is no
'DatabaseName. Use an empty string.
'For example, .DatabaseName = ""

.DatabaseName = ""
.UserID = "myID"
.Password = "myPwd"
End With

CrTables = oRpt.Database.Tables

'Loop through each table in the report and apply the
'LogonInfo information

For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo

'CrystalReportViewer1.DisplayToolbar = False
CrystalReportViewer1.DisplayGroupTree = False
'Set the report source to the report component.
CrystalReportViewer1.ReportSource = oRpt
Catch exp As Exception
'Publish the error to the log file
'Add an error to the page Errors collection
Me.ErrorsList.Add("An error occured while connecting to
the database. Please contact the system administrator.")
End Try
End Sub

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
'Do not modify it using the code editor.
End Sub

#End Region

End Class
'=========================END WEB FORM CODE ===============
Jul 21 '05 #1
0 2553

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

Similar topics

by: Bonj | last post by:
Hi I am trying to create a simple 'hello world' type web application involving a crystal report. I have basically done it the simplest possible way as described in the documentation, by adding a...
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and...
by: GFro | last post by:
I am getting the following error since we upgraded from .NET Framework 1.0 to 1.1. The reports all ran fine yesterday. I get this error in all apps with reports. The apps run fine but the...
by: Milan Todorovic | last post by:
Hello, I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report purely for testing purposes: connect to...
by: mollyf | last post by:
I have tried various suggestions that I have found searching the newsgroups and still haven't been able to figure why I keep getting the logon failed error. I created a report in Crystal (not...
by: Shawn H. Mesiatowsky | last post by:
I have come across lots of information regarding this, but nothing seems to work. I have created a Crystal Report that access's a SQL server backend for the data, and I want to display the report...
by: Michael O'Donnell | last post by:
Hi All Am having major problem with crystal reports...Have designed my report no problem, its when I try to run and display ther report that I am getting a "Login Failed" message. At first I...
by: Max | last post by:
Hi wise people, Has anyone encountered the Crystal Reports problem I describe below? If so, how did you solve it? It seems that every article posted on google regarding CR and logon problems is...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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$) { } ...
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...
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
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...

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.