Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logon failed because need to add User name and password
Message
De
11/07/2005 12:06:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
01031269
Message ID:
01031290
Vues:
18
>I need to know what line of code to add to a VB.NET application that runs a Crystal Report so I don't get the following logon failed error. I also put this question in the .NET UT area, but this is more of a Crystal Reports issue so I am also putting the question here:
>
>ERROR -
>Logon failed.
>
>I have tested this application on a standalone PC simply working from a hard drive database and no user name and password was needed and so I know everythings works once I solve this error.
>
>Here is my code which uses a Crystal ActiveX Viewer on a VB.NET form:
>
>Public Class Form4
>    Inherits System.Windows.Forms.Form
>
>#Region " Windows Form Designer generated code "
>
>    Public Sub New()
>        MyBase.New()
>
>        'This call is required by the Windows Form Designer.
>        InitializeComponent()
>
>        'Add any initialization after the InitializeComponent() call
>
>    End Sub
>
>    'Form overrides dispose to clean up the component list.
>    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
>        If disposing Then
>            If Not (components Is Nothing) Then
>                components.Dispose()
>            End If
>        End If
>        MyBase.Dispose(disposing)
>    End Sub
>
>    'Required by the Windows Form Designer
>    Private components As System.ComponentModel.IContainer
>
>    'NOTE: The following procedure is required by the Windows Form Designer
>    'It can be modified using the Windows Form Designer.
>    'Do not modify it using the code editor.
>    Friend WithEvents Button2 As System.Windows.Forms.Button
>    Friend WithEvents Button1 As System.Windows.Forms.Button
>    Friend WithEvents crViewer As CrystalActiveXReportViewerLib11.CrystalActiveXReportViewerClass
>    Friend WithEvents AxCrystalActiveXReportViewer1 As AxCrystalActiveXReportViewerLib11.AxCrystalActiveXReportViewer
>    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
>        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form4))
>        Me.Button2 = New System.Windows.Forms.Button
>        Me.Button1 = New System.Windows.Forms.Button
>        Me.AxCrystalActiveXReportViewer1 = New AxCrystalActiveXReportViewerLib11.AxCrystalActiveXReportViewer
>        CType(Me.AxCrystalActiveXReportViewer1, System.ComponentModel.ISupportInitialize).BeginInit()
>        Me.SuspendLayout()
>        '
>        'Button2
>        '
>        Me.Button2.Location = New System.Drawing.Point(415, 576)
>        Me.Button2.Name = "Button2"
>        Me.Button2.TabIndex = 7
>        Me.Button2.Text = "Continue"
>        '
>        'Button1
>        '
>        Me.Button1.Location = New System.Drawing.Point(503, 576)
>        Me.Button1.Name = "Button1"
>        Me.Button1.TabIndex = 8
>        Me.Button1.Text = "Cancel"
>        '
>        'AxCrystalActiveXReportViewer1
>        '
>        Me.AxCrystalActiveXReportViewer1.Enabled = True
>        Me.AxCrystalActiveXReportViewer1.Location = New System.Drawing.Point(16, 16)
>        Me.AxCrystalActiveXReportViewer1.Name = "AxCrystalActiveXReportViewer1"
>        Me.AxCrystalActiveXReportViewer1.OcxState = CType(resources.GetObject("AxCrystalActiveXReportViewer1.OcxState"), System.Windows.Forms.AxHost.State)
>        Me.AxCrystalActiveXReportViewer1.Size = New System.Drawing.Size(960, 544)
>        Me.AxCrystalActiveXReportViewer1.TabIndex = 9
>        '
>        'Form4
>        '
>        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
>        Me.ClientSize = New System.Drawing.Size(992, 614)
>        Me.Controls.Add(Me.AxCrystalActiveXReportViewer1)
>        Me.Controls.Add(Me.Button1)
>        Me.Controls.Add(Me.Button2)
>        Me.Name = "Form4"
>        Me.Text = "BayForce Technology Solutions"
>        CType(Me.AxCrystalActiveXReportViewer1, System.ComponentModel.ISupportInitialize).EndInit()
>        Me.ResumeLayout(False)
>
>    End Sub
>
>#End Region
>    Dim crxApplication As New CRAXDRT.Application
>    Public oReport As CRAXDRT.Report
>    Public cboRpt1, cboRpt2 As String
>    Public start_date, end_date As String
>
>    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>
>        If cboRpt1 = 0 And cboRpt2 = 0 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>            oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text))
>            oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text))
>        ElseIf cboRpt1 = 0 And cboRpt2 = 1 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>            oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text))
>            oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text))
>        ElseIf cboRpt1 = 0 And cboRpt2 = 2 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>            oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text))
>            oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text))
>        ElseIf cboRpt1 = 1 And cboRpt2 = 0 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 1 And cboRpt2 = 1 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 1 And cboRpt2 = 2 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 1 And cboRpt2 = 3 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>            oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text))
>            oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text))
>        ElseIf cboRpt1 = 1 And cboRpt2 = 4 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>            oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text))
>            oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text))
>        ElseIf cboRpt1 = 2 And cboRpt2 = 0 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 2 And cboRpt2 = 1 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 2 And cboRpt2 = 2 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 2 And cboRpt2 = 3 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 2 And cboRpt2 = 4 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        ElseIf cboRpt1 = 2 And cboRpt2 = 5 Then
>            oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1)
>        End If
>
>        AxCrystalActiveXReportViewer1.ReportSource = oReport
>        AxCrystalActiveXReportViewer1.ViewReport()
>    End Sub
>
>    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
>        Me.Hide()
>        F1.Show()
>    End Sub
>
>    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
>        Me.Hide()
>    End Sub
>End Class
>
>
>Thanks for your help.

KB319264 might help.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform