I am using Service Pack 9 of Crystal Reports for Visual Studio.
The only difference with the CrystalReportViewer between the test app and my app was that my app has CrystalReportViewer configured to point to the ReportSource object which in turn points to the .rpt file. The test app you have me create does not have the ReportSource object and just has the following line of code to view the Formulas.rpt:
CrystalReportViewer1.ReportSource = "~/Formulas.rpt"
In the test app, I have been putting in code from my app to narrow down when the CrystalReportViewer will not be shown. Here is the code:
Dim Rpt1 As ReportDocument
Rpt1 = New ReportDocument
'Rpt1.Load(Server.MapPath("~/PlexHShipmentYWSumReport_2.rpt"))
'Rpt1.SetDatabaseLogon("user", "password", "888.9.1.77", "GTRANS01")
'Rpt1.SetDataSource(dsData)
'CrystalReportViewer1.ReportSource = "~/PlexHShipmentYMSumReport_2.rpt"
CrystalReportViewer1.ReportSource = "~/Formulas.rpt"
A single quote is used to comment out the Rpt1.Load, Rpt1.SetDatabaseLogon, Rpt1.SetDataSource, and the first CrystalReportViewer1.ReportSource lines of code.
With those lines of code commented out, the CR Viewer shows the Formulas.rpt report file.
If I uncomment out the CR Viewer for PlexHShipmentYMSumReport_2.rpt and comment out the CR Viewer for Formulas.rpt then the CR Viewer is displayed with the following:
Error
Database Logon failed
But no matter what .rpt is used with the CR Viewer, when Rpt1.Load or Rpt1.SetDataSource is uncommented out then the CR Viewer is NOT shown. I do not understand why that happens. I need help to fix that.
With the test app, the web.config was not changed at all.
In my app, when I comment out those Rpt1 lines then the CR Viewer is displayed with an error or shows the report with the saved data.
Please help.