VB.net error (Load Report Failed) When RPT file being open in Crystal Reports designer
<p>I use VB.net 2010 and Crystal Report XI.
I want to load the report in a report viewer, but when i open the rpt file in crystal reports designer, the report viewer in vb.net give error : load report failed.</p>

<p>But when i close the crystal report software or just close the rpt file from crystal reports software, then the report viewer can run just fine.
Do i really have to close crystal reports every time i want to open the rpt file from report viewer in vb.net.?</p>

<p>In case of being needed, this is my code:</p>

<pre><code>Dim Report As New ReportDocument
    Dim Report1 As New ReportDocument
    Dim li As New TableLogOnInfo
    Dim tbs As Tables
    Dim tb As Table
    Try
        Report.Load(reportLocation &amp; filename)

        li.ConnectionInfo.DatabaseName = dbname
        li.ConnectionInfo.UserID = userid
        li.ConnectionInfo.Password = password
        li.ConnectionInfo.ServerName = servername

        tbs = Report.Database.Tables
        For Each tb In Report.Database.Tables
            tb.ApplyLogOnInfo(li)
        Next

        Report.RecordSelectionFormula += IIf(Report.RecordSelectionFormula &lt;&gt; "", " and ", "") &amp; formula
        Report.Refresh()
        Report.SetParameterValue(0, param(0))
        Report.SetParameterValue(1, param(1))
        Report.SetParameterValue(2, param(2))
        If param(3) &lt;&gt; "" Then Report.SetParameterValue(3, param(3))

        crV.ReportSource = Report
        crV.Show()
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
</code></pre>

<p>In case of being asked, I use windows 10 and SQL Server 2008 R2 SP2.</p>