Results 1 to 2 of 2

Thread: how do I stop it asking for db login credentials at CR report viewer launch

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    4

    how do I stop it asking for db login credentials at CR report viewer launch

    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.

    Code:
    <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!!!

  2. #2

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    4

    Re: how do I stop it asking for db login credentials at CR report viewer launch

    I have tried everything on this. My latest attempt is a dataset in the form of an xsd. The data adapter does not need to be created, it is in my project. Though I don't know if I need to tie it to something else in some way. I create the table which contains the data using one button. That is all working well. Table gets created in the tempdb with the correct data and the parameters are all passed correctly. I am trying to fill the dataset before the viewer launches. The crystal report has it's ource 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.

    Code:
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width