473,503 Members | 5,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why it doesn't work

Hello! i try to dispay a report using Crystal Report for
vusual studio .NET and recieve a message
[LogOnException: Logon failed.]
There is a code:
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine

Dim crReportDocument As home_energy1
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
Dim crParameterFields As ParameterFields
Dim crParameterField As ParameterField
Dim crParameterValues As ParameterValues
Dim crParameterDiscreteValue As
ParameterDiscreteValue

crReportDocument = New home_energy1()

''Setup the connection information structure to be
used
''to log onto the datasource for the report.
crConnectionInfo = New ConnectionInfo()
With crConnectionInfo
.ServerName = "(local)" 'physical server name
.DatabaseName = "EZ"
.UserID = "ezuserid"
.Password = "password"
End With

'Get the table information from the report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables

'Loop through all tables in the report and apply
the connection
'information for each table.
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo =
crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next

Me.CrystalReportViewer1.ReportSource =
crReportDocument

'Get the collection of parameters from the report
crParameterFields =
CrystalReportViewer1.ParameterFieldInfo

'Access the specified parameter from the collection
crParameterField = crParameterFields.Item
("v_userid")

'Get the current values from the parameter field.
At this point
'there are zero values set.
crParameterValues = crParameterField.CurrentValues

'Set the current values for the parameter field
crParameterDiscreteValue = New
ParameterDiscreteValue()
crParameterDiscreteValue.Value = "111111111"

'Add the first current value for the parameter
field
crParameterValues.Add(crParameterDiscreteValue)
'the new parameter information can be used for the
report.
CrystalReportViewer1.ParameterFieldInfo =
crParameterFields
If anyone khows what is going on please help!
Nov 17 '05 #1
0 732

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

Similar topics

7
4860
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
39
3281
by: Mark Johnson | last post by:
It doesn't seem possible. But would the following also seem a violation of the general notions behind css? You have a DIV, say asociated with class, 'topdiv'. Inside of that you have an anchor...
149
24963
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
4
3392
by: bbp | last post by:
Hello, In an ASPX page I have a "Quit" button which make a simple redirect in code-behind. This button doesn't work no more since (I think) I moved from the framework 1.0 to 1.1 and it doesn't...
39
5823
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
7194
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,...
1
6976
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...
0
7449
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...
0
5566
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,...
0
4666
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...
0
3160
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...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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...

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.