If I run a report (from within the IDE), I get a "Load Report Failed" error, followed by me having to enter the database password. Then I get the report displayed and another "Load Report Failed" message. However, If I step through the report (in the IDE), it runs fines. No need to re-eenter password, no load errors.

Also, if I use the Windows Explrer to find my project file & double click, it comes fine. If I start VB2005 and try the 'open project' on the file it brings up some HTML stuff. I am selecting the same file in both cases.

my CRViewer code:

VB Code:
  1. Option Strict Off
  2. Option Explicit On
  3. Imports CrystalDecisions.CrystalReports.Engine
  4. Imports CrystalDecisions.Shared
  5.  
  6.  
  7. Friend Class CRViewer
  8.     Inherits System.Windows.Forms.Form
  9.     'Private rsMachine As ADODB.Recordset
  10.     'Private Const PARAMETER_FIELD_NAME As String = "Machine"
  11.  
  12.     Private Sub ConfigureCrystalReports()
  13.  
  14.         CRViewer1.ReportSource = Nothing
  15.         CRViewer1.SelectionFormula = ""
  16.  
  17.         Dim myConnectionInfo As ConnectionInfo
  18.         Dim ReportPath As String
  19.          Dim mySelectionFormula As String = ""
  20.         myConnectionInfo = New ConnectionInfo
  21.         With myConnectionInfo
  22.             .ServerName = "Primero"
  23.             .DatabaseName = "Tooling"
  24.             .UserID = "sa"
  25.             .Password = myPasswordTechniSQL
  26.         End With
  27.  
  28.  
  29.         Select Case glbReportname
  30.             Case "Z:\Tooling\PartialToolList.rpt"
  31.                 mySelectionFormula = "{MachineTool.Machine} = " & Val(glbreportParam)
  32.                 ReportPath = Application.StartupPath & "\PartialToolList.rpt"
  33.                 CRViewer1.SelectionFormula = mySelectionFormula
  34.                 CRViewer1.ReportSource = ReportPath
  35.                 SetDBLogonForReport(myConnectionInfo)
  36.              Case "Z:\Tooling\Tooling.rpt"
  37.                 ReportPath = Application.StartupPath & "\Tooling.rpt"
  38.                 CRViewer1.ReportSource = ReportPath
  39.                 SetDBLogonForReport(myConnectionInfo)
  40.             Case "Z:\Tooling\FullToolList.rpt"
  41.                 ReportPath = Application.StartupPath & "\FullToolList.rpt"
  42.                 CRViewer1.ReportSource = ReportPath
  43.                 SetDBLogonForReport(myConnectionInfo)
  44.             Case "Z:\Tooling\Xref.rpt"
  45.                 ReportPath = Application.StartupPath & "\Xref.rpt"
  46.                 CRViewer1.ReportSource = ReportPath
  47.                 SetDBLogonForReport(myConnectionInfo)
  48.             Case Else
  49.         End Select
  50.  
  51.      End Sub
  52.    
  53.     Private Sub CRViewer_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
  54.         On Error GoTo errorhandler
  55.  
  56.         ConfigureCrystalReports()
  57.  
  58.         Exit Sub
  59. errorhandler:
  60.         System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
  61.         MsgBox("An error occurred: [" & Err.Number & "] " & Err.Description & " - Source: " & Err.Source)
  62.     End Sub
  63.    
  64.     Private Sub CRViewer_Resize(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Resize
  65.  
  66.         CRViewer1.Top = 0
  67.         CRViewer1.Left = 0
  68.         CRViewer1.Height = ClientRectangle.Height
  69.         CRViewer1.Width = ClientRectangle.Width
  70.         CRViewer1.Zoom(75)
  71.  
  72.     End Sub
  73.    
  74.     Private Sub CRViewer_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
  75.     'Me = Nothing
  76.     End Sub
  77.     Private Sub SetDBLogonForReport(ByVal myConnecionInfo As ConnectionInfo)
  78.         Dim myTableLogOnInfos As TableLogOnInfos = CRViewer1.LogOnInfo
  79.  
  80.         For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
  81.             myTableLogOnInfo.ConnectionInfo = myConnecionInfo
  82.         Next
  83.  
  84.     End Sub
  85.     Private Sub SetCurrentValuesForParameterField(ByVal myParameterFields As ParameterFields, ByVal myArrayList As ArrayList)
  86.         'Dim cPV As ParameterValues = New ParameterValues()
  87.  
  88.         'For Each submittedValue As Object In myArrayList
  89.         '    Dim myParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()
  90.         '    myParameterDiscreteValue.Value = submittedValue.ToString()
  91.         '    cPV.Add(myParameterDiscreteValue)
  92.         'Next
  93.         'Dim myParameterField As ParameterField = myParameterFields(PARAMETER_FIELD_NAME)
  94.         'myParameterField.CurrentValues = cPV
  95.  
  96.     End Sub
  97. End Class