visual studio .net general:
I'm having an issue calling crystal reports 10 within vb.net 2003
I can call the report and print the report all day long.
The issue occurs when I choose to export the report. Works like a
champ the first time... everything exports great. But once the user
has exported, they are no longer able to run reports (print, export,
or even view)
It is almost like once the report has been exported the predefined
cache is full and can't clear....
Any Ideas?
The message that is given is:
An unhandled exception of type 'System.Exception' occurred in
crystaldecisions.crystalreports.engine.dll
Additional information: Load report failed.
Here is a snipet of my code:
'Load Crystal Report
Public Sub LoadCR(ByVal ds_Gview4 As DataSet, ByVal rptpath As
String, ByVal ds_TotRev As DataSet, ByVal Loc As String)
myrpt = rptpath
totRev = ds_TotRev
Dim CReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocument
'Load Agency and Module Name
Dim CRText As Engine.TextObject
Dim CRText2 As Engine.TextObject
Dim CRText3 As Engine.TextObject
CReport.Load(myrpt)
If myrpt <> "GLLoadFile.rpt" Then
CRText =
CType(CReport.ReportDefinition.ReportObjects("txtAgency"),
Engine.TextObject)
CRText2 =
CType(CReport.ReportDefinition.ReportObjects("txtModule"),
Engine.TextObject)
CRText3 =
CType(CReport.ReportDefinition.ReportObjects("txtLocation"),
Engine.TextObject)
CRText.Text = globalclass.orgnam
CRText2.Text = globalclass.selmod
CRText3.Text = Loc
End If
CReport.SetDataSource(ds_Gview4.Tables(0))
'Only use on the IncomeStatement for Total Revenue
If IncomeState.rptflg = True Then
'CReport.SetDataSource(totRev.Tables(0))
If myrpt = "IncomestateForecast.rpt" Then
CReport.Database.Tables("glmodbal").SetDataSource(totRev.Tables(0))
End If
CReport.Database.Tables("glbalance").SetDataSource(ds_Gview4.Tables(0))
Else
CReport.SetDataSource(ds_Gview4.Tables(0))
End If
CRViewer.ReportSource = (CReport)
End Sub