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

Error setting Server logon info for crystal reports

Hi,

I get the following error when I try to connect to my server to run a crystal report:

Object reference not set to an instance of an object

The code works fine without the parameter, but I don't know why it is not working with the parameter added.

rpt = New CrystalReport1()
Dim reportPath As String = "C:\Crystal Report\Crystalreport1.rpt"
Dim myConnectionInfo As CrystalDecisions.Shared.ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()
myConnectionInfo.ServerName = [servername here]
myConnectionInfo.DatabaseName = "[database name here]"
myConnectionInfo.UserID = "[user name here]"
myConnectionInfo.Password = "[password here]"
Dim myTableLogOnInfos As CrystalDecisions.Shared.TableLogOnInfos = CView.LogOnInfo
For Each myTableLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next

CView.ReportSource = rpt
Dim field1 As ParameterField = Me.CView.ParameterFieldInfo(0)
Dim val1 As ParameterDiscreteValue = New ParameterDiscreteValue
val1.Value = "2/20/2007"
field1.CurrentValues.Add(val1)
rpt.Load(reportPath)

I would really appretiate the help.
Lawrence
Apr 3 '07 #1
1 1826
Hi,

I get the following error when I try to connect to my server to run a crystal report:

Object reference not set to an instance of an object

The code works fine without the parameter, but I don't know why it is not working with the parameter added.

rpt = New CrystalReport1()
Dim reportPath As String = "C:\Crystal Report\Crystalreport1.rpt"
Dim myConnectionInfo As CrystalDecisions.Shared.ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()
myConnectionInfo.ServerName = [servername here]
myConnectionInfo.DatabaseName = "[database name here]"
myConnectionInfo.UserID = "[user name here]"
myConnectionInfo.Password = "[password here]"
Dim myTableLogOnInfos As CrystalDecisions.Shared.TableLogOnInfos = CView.LogOnInfo
For Each myTableLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next

CView.ReportSource = rpt
Dim field1 As ParameterField = Me.CView.ParameterFieldInfo(0)
Dim val1 As ParameterDiscreteValue = New ParameterDiscreteValue
val1.Value = "2/20/2007"
field1.CurrentValues.Add(val1)
rpt.Load(reportPath)

I would really appretiate the help.
Lawrence

I found this one out finally.

http://www.instantcrystal.net/instantguide.aspx

Download the above file follow the directions carefully it worked for me. Hope this helps.

RTW
May 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
2
by: Mark Miller | last post by:
I'm not sure why this is happening. I'm trying to run a late-bound report. My original code looked like this: TableLogOnInfo logOnInfo = new TableLogOnInfo ();...
2
by: Jonathan | last post by:
Hi all, It's my first post here, so be kind :) I got a little application that keep track of a small inventory, everything was going great until came the time to make some types of reports. I...
1
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
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....
6
by: Alixx Skevington | last post by:
OK why does the following code work in a Windows form with a crystal report viewer but not in a webform. I get the usual CrystalReports.EngineLogONException logon Failed when this is called in...
0
by: Timmy Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
3
by: Hugh O | last post by:
Hi, I have been trying to load a Crystal Report newly created via VS.Net 2003. I am using a simply ASP form with only the Crystal Report Viewer. The sample report results display in the...
3
by: Santosh | last post by:
Hii , i am developing an web application using asp.net with in it reporting purpose i am using crystal reports. it is working on fine on local server. but when i deploy it on web server it gives...
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...
0
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...
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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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....

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.