Skip to Content
0
Nov 26, 2011 at 05:15 AM

CR 2010/VS 2008 Navigation Problem - Object reference not set to an instanc

76 Views

I am trying to display a report in an ASP.NET website. I have Crystal Reports 2010 installed and I am developing in VS 2008. I have a report that is bound to a ADO.NET Dataset. At runtime, I set the report datasource to a dataset I fill from an SQL query. The Crystal Viewer shows the first page but if I try to navigate to the next page, I get the following error:

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\Users\dperry\AppData\Local\Temp\MD-RentComplaint {3BC40AC8-09CB-4530-A32F-DCF427468D28}.rpt: Unable to connect: incorrect log on parameters.

The report is not bound to a database object so why am I getting a Logon failed error?

Here is my code to set the report source:

ReportInfo ri = Session["ReportInfo"] as ReportInfo;

if (ri == null) return;

Page.Title = ri.ReportTitle;

ReportDocument rdoc = new ReportDocument();

rdoc.Load(Server.MapPath("~/system/reports/rpt-files/" + ri.ReportName + ".rpt"));

rdoc.SetDataSource(ri.Datasource);

rdoc.Refresh();

CrystalReportViewer1.ReportSource = rdoc;

CrystalReportViewer1.RefreshReport();

Thanks in advance for your help.