Hello,
I have a desktop application that was developed in VS 2005. Recently I upgraded the solution to VS 2010. It prompted me that I should install the SAP crystal report separately and I installed the Crystal Report for Visual Studio 2010 installation.
The rpt files were developed using Crystal Report 9.
However after the upgrade the reports fails to display. If i debug the code and step through the crystal report will display the first time i select a rpt but hangs the second time i select another rpt. I created a simple crystal report using Crystal Report 9 and it works with my upgraded application. But my original complex report does not load. It hangs saying Please wait while the document is being processed and freezes there.
I am using SQL Server 2008 and I have made sure that I am using SQL Server Native Client 10.
I use an ODBC(RDO) in my simple report and complex report.
I tried upgrading my complex crystal report using Visual Studio 2010 interface. This did not help as well.
Here is the code that I use to display the report. It works in the old Visual Studio.
ReportDocument rd = new ReportDocument();
rd.Load(reportPath + cmbReport.Text);
rd.SetDatabaseLogon(userID, pwd, WNPOCDataPvd.DSN, string.Empty);
TableLogOnInfos infos = new TableLogOnInfos();
foreach(Table t in rd.Database.Tables)
{
TableLogOnInfo inf = t.LogOnInfo;
ConnectionInfo connect = inf.ConnectionInfo;
connect.ServerName = WNPOCDataPvd.DSN;
connect.DatabaseName = string.Empty;
connect.UserID = userID;
connect.Password = pwd;
t.ApplyLogOnInfo(inf);
infos.Add(inf);
}
crystalReportViewer1.LogOnInfo = infos;
crystalReportViewer1.ReportSource = rd;
Few issues I noticed
1) The upgraded code (VS 2010) is able to display a simple report but not my complex report. The previous version was able to display my complex report.
2) If I step through the code (debug), then my complex report will display the first time, but if I try to select a new report (from a combo box) and run this code again in debug mode it hangs at crystalReportViewer1.ReportSource = rd;.
3) If I just run the code (without stepping through) then the application hangs.
Thanks
Anina