473,326 Members | 2,010 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,326 software developers and data experts.

Crystal Reports for .NET and Oracle problem - Logon failed

Max
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
(http://support.businessobjects.com/l.../c2010371.asp).
Unfortunately I keep getting a logon failure.
Any ideas about this problem?
I appreciate your help.
Max.

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
CrystalDecisions.Web.CrystalReportViewer

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

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

#End Region

#Region "Public properties"
Private Property StartDate()
Get
Return mStartDate
End Get
Set(ByVal Value)
mStartDate = Value
End Set
End Property
Private Property EndDate()
Get
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
Try

'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
dataset
' to report
oRpt.SetDataSource(ds)

'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
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next

'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
ExceptionManager.Publish(exp)
'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
InitializeComponent()

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
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

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

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

Similar topics

0
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...
0
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...
2
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...
2
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...
3
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...
9
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...
3
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...
19
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
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 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.