Crystal Reports (VS 2010) report not showing up and not throwing any errors
-
31-05-2021 - |
Question
I'm trying to get a Crystal Report to show up on a web page. My code looks like this:
ReportDocument rd = new ReportDocument();
rd.Load(@"C:\projects\reports\testreport.rpt");
rd.SetDatabaseLogon("sa", "thepassword");
CRViewer.ReportSource = rd;
I've worked through several actual errors already to get to where I am now. The last error I had was that the connection couldn't be made, but when I added the SetDabaseLogon call to use SQL Server Auth security instead of integrated that problem was fixed.
Now I am not getting any error at all but the report simply doesn't show up.
I'm at a loss as to what to try now, any ideas would be appreciated!
(I don't know if this is really relevant or not, but this is in a SharePoint web part that I'm creating.)
Solution
Try adding this line: CRViewer.Show();
If it isn't that simple, then I'd run the application outside of the webpart wrapping to at least confirm/deny if it being in SharePoint is related.