473,847 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error setting Server logon info for crystal reports

41 New Member
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\Crystalr eport1.rpt"
Dim myConnectionInf o As CrystalDecision s.Shared.Connec tionInfo = New CrystalDecision s.Shared.Connec tionInfo()
myConnectionInf o.ServerName = [servername here]
myConnectionInf o.DatabaseName = "[database name here]"
myConnectionInf o.UserID = "[user name here]"
myConnectionInf o.Password = "[password here]"
Dim myTableLogOnInf os As CrystalDecision s.Shared.TableL ogOnInfos = CView.LogOnInfo
For Each myTableLogOnInf o As CrystalDecision s.Shared.TableL ogOnInfo In myTableLogOnInf os
myTableLogOnInf o.ConnectionInf o = myConnectionInf o
Next

CView.ReportSou rce = rpt
Dim field1 As ParameterField = Me.CView.Parame terFieldInfo(0)
Dim val1 As ParameterDiscre teValue = New ParameterDiscre teValue
val1.Value = "2/20/2007"
field1.CurrentV alues.Add(val1)
rpt.Load(report Path)

I would really appretiate the help.
Lawrence
Apr 3 '07 #1
1 1844
rtwPhoenix
13 New Member
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\Crystalr eport1.rpt"
Dim myConnectionInf o As CrystalDecision s.Shared.Connec tionInfo = New CrystalDecision s.Shared.Connec tionInfo()
myConnectionInf o.ServerName = [servername here]
myConnectionInf o.DatabaseName = "[database name here]"
myConnectionInf o.UserID = "[user name here]"
myConnectionInf o.Password = "[password here]"
Dim myTableLogOnInf os As CrystalDecision s.Shared.TableL ogOnInfos = CView.LogOnInfo
For Each myTableLogOnInf o As CrystalDecision s.Shared.TableL ogOnInfo In myTableLogOnInf os
myTableLogOnInf o.ConnectionInf o = myConnectionInf o
Next

CView.ReportSou rce = rpt
Dim field1 As ParameterField = Me.CView.Parame terFieldInfo(0)
Dim val1 As ParameterDiscre teValue = New ParameterDiscre teValue
val1.Value = "2/20/2007"
field1.CurrentV alues.Add(val1)
rpt.Load(report Path)

I would really appretiate the help.
Lawrence

I found this one out finally.

http://www.instantcrys tal.net/instantguide.as px

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
1707
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, or in the code) works fine. However, when I try to add any parameter through the record selection formula and/or the report parameters method, the report crashes. I have tried each of the methods:
2
5350
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 (); logOnInfo.ConnectionInfo.ServerName = "<server name>"; logOnInfo.ConnectionInfo.DatabaseName = "<dbname>"; logOnInfo.ConnectionInfo.UserID = "<user id>"; logOnInfo.ConnectionInfo.Password = "<password>"; logOnInfo.TableName = "Student";
2
2342
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 want to use Crystal Reports in the background to generate the reports for me, i don't want any preview, any popup (only a print dialog then send it to the selected printer). That should be pretty easy ;) First of all, my app doesnt make any use of...
1
1687
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, or in the code) works fine. However, when I try to add any parameter through the record selection formula and/or the report parameters method, the report crashes. I have tried each of the methods:
7
5039
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...
6
1680
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 aspx. Any help will be very much apprecaited Alixx This is the code in the calling aspx Page
0
1728
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, or in the code) works fine. However, when I try to add any parameter through the record selection formula and/or the report parameters method, the report crashes. I have tried each of the methods:
3
1688
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 WebForm1.aspx, when I have set the databinding Report Source property set at design time. I get the following error message when I try to run the report. CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. In searching Google, in...
3
2274
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 me an keycodedll error. i am trying the things like building web set up adding merge modules. passing registration key from .Net Help menu, About.Net. but it still giving same error. can anyone tell me can it is sufficient to pass registration key...
0
9734
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10653
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
10718
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
10347
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...
1
7888
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7061
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
5725
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
4540
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
3
3168
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.