Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Crystal Viewer asks for database login. Cannot figure it out. Have read posts on this but can't...


Crystal Viewer asks for database login. Cannot figure it out. Have...

Author
Message
jason@home
jason@home
Forum God
Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)

Group: Forum Members
Posts: 4, Visits: 10
I have a VS 2008 app I am building. I REALLY need your help VB Crystal Reports Experts! Works great but asks for database credentials when Crystal Reports Viewer attempts to launch the report. The stucture is that the app passes parameters to a stored procedure on a MS SQL box which creates a temporary table. Then the CR inside of the CRviewer reports on the temporary table. All works fine except that the user is prompted for DB credentials (information they are not allowed to know), when the CRviewer launches. I have been struggling with this for a week! I have searched and searched the code here and everywhere else but I cannot find something that works or if I do find something, I am affraid to try it because I don't know where it should go? I think maybe it needs to be part of this but I don't know if this is where it belongs or what the code should be.

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class RptViewer
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    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.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.CrystalReportViewer1 = New CrystalDecisions.Windows.Forms.CrystalReportViewer
        Me.Exp_Auth1 = New AuthApp.Exp_Auth
        Me.SuspendLayout()
        '
        'CrystalReportViewer1
        '
        Me.CrystalReportViewer1.ActiveViewIndex = 0
        Me.CrystalReportViewer1.AutoSize = True
        Me.CrystalReportViewer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.CrystalReportViewer1.DisplayGroupTree = False
        Me.CrystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.CrystalReportViewer1.Location = New System.Drawing.Point(0, 0)
        Me.CrystalReportViewer1.Name = "CrystalReportViewer1"
        Me.CrystalReportViewer1.ReportSource = Me.Exp_Auth1
        Me.CrystalReportViewer1.Size = New System.Drawing.Size(1034, 1054)
        Me.CrystalReportViewer1.TabIndex = 0
        Me.SetDatabaseLogon("pwhcprod01", "Pwhcprod01")
        '
        'RptViewer
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(1034, 1054)
        Me.Controls.Add(Me.CrystalReportViewer1)
        Me.Name = "RptViewer"
        Me.Text = "RptViewer"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer
    Friend WithEvents Exp_Auth1 As AuthApp.Exp_Auth
End Class

ALL help is very much appreciated. I am a newbie but I have built a great app that fully meets some complex business requirements. All I need now is to get past this one last thing!!!

Destroyer
Destroyer
Forum God
Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)

Group: Forum Members
Posts: 244, Visits: 188
Jason, did you by any chance recently upgrade your Visual Studio software? I have heard others having this problem after upgrading their software. Problem had to do with mixed .dlls. Not all crystal report dlls were updated to the new version.

Destroyer Smooooth
jason@home
jason@home
Forum God
Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)

Group: Forum Members
Posts: 4, Visits: 10
Hi Distroyer.  Thanks but no, I have not updated anything.  I think it is that I simply don't know where the credentials should go so that they are passed when the cyrstal report calls for the data from the database from inside the viewer....
jason@home
jason@home
Forum God
Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)

Group: Forum Members
Posts: 4, Visits: 10
I worry that my mistake is in something more basic than something complex. Maybe I am doing or not doing something in the location if belongs. Like not even in the form it belongs in. I don't know if I was even attempting correctly because to begin I do not know where the credential code needs to go. Does it go into the code for the CR viewer page? Does it go in both? Do I use a data adapter? If so, am I doing it correctly. I have one version that uses a data adapter and it simply comes up blank. The other version where I do not is the one that does produce the report correctly but asks for the credentials that the user is not allowed to know. Does it go into the code for the main application that is launching the CR viewer? Does the fact that my CR is run off of a temporary table which is created by the main application and then reported upon by the CR change the situation? This works correctly. I have all the parameters passing to the SP and all the data is coming into the the temp table in the tempdb. But when the CR viewer is launched as another form from the main application; it asks for the database credentials at this time. Everything I have done to attempt to embed these credentials has either not changed the situation and all runs the same. Or it causes the report to come up blank even though the data is all in the table when I look at the table in MS SQL. I would love it if you could tell me where to put the code for the db credentials and if you see any basic flaws in what I am doing. Sorry for being such a newbie. I am learning quick! Thanks!
Destroyer
Destroyer
Forum God
Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)Forum God (42K reputation)

Group: Forum Members
Posts: 244, Visits: 188
Have you tried adding the login credentials programmatically during runtime? Also, are you using integrated security? If so try setting integrated security to false.



myConnection.IntegratedSecurity = False

Destroyer Smooooth
Edited
11/14/2012 by Destroyer
jason@home
jason@home
Forum God
Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)

Group: Forum Members
Posts: 4, Visits: 10
I have tried everything on this.  I cannot use integrated security.  I have set the integrated security to false.  Nothing working.  My latest attempt is a dataset in the form of an xsd.  I am trying to fill the dataset before the viewer launches.  The crystal report has it's source location set to the dataset.  But the report just comes up empty.  Here is the code I am using to attempt to fill the dataset and launch the report viewer.

Private Sub LaunchRptBtn_Click() Handles LaunchRpt.Click

Dim ViewerForm As New Form

Dim DS As New TempdbDataSet

Dim DS_Adapter As New TempdbDataSetTableAdapters.TempdbTableAdapter

DS_Adapter.GetData()

DS_Adapter.Fill(DS.TempdbTable)

ViewerForm = RptViewer

ViewerForm.Show()

End Sub


GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search