0

I have been trying to display a Crystal Reports report inside a ASP.NET application I designed. The report is properly made, and in fact in Visual Studio I can see the report loading in the preview page. The problem comes when I try to open the page I have the report in my browser. Nothing displays. Not an error, nothing. Tried IE, Firefox, etc.

I used the built in Crystal Reports Viewer tool and added the report there as a source. Then I added the next in code:

      ReportDocument crystalReport = new ReportDocument();
        crystalReport.Load(Server.MapPath("~/CrystalReport3.rpt"));
        crystalReport.SetDatabaseLogon
            ("suer", "apss", @"servername", "DBNAME");
        CrystalReportViewer1.ReportSource = crystalReport;

Yet nothing loads. Nothing. Have been at this well for a day now but no go. Any help would be greatly appreciated.

Lord Relix
  • 882
  • 2
  • 19
  • 49

1 Answers1

0

If you use "~" to specify the Server.MapPath, the report must be at the root of your project. Maybe try specifying a different location. See this post which explains the different options very well. I personally use a CrystalReportSource in my projects and specify a mapped drive where all my reports reside.

Hope that helps,

Chris

Community
  • 1
  • 1
campagnolo_1
  • 2,640
  • 1
  • 15
  • 24
  • Tried. No go. I actually believe the report IS loading, because if I select a wrong address it wll throw me an exception. So it must be loading the report, the problem seems to be in the rendering. – Lord Relix Oct 21 '13 at 18:38
  • Are you seeing the ReportViewer frame at all? Basically, does the report just not have any records or is NOTHING showing (blank page)? – campagnolo_1 Oct 21 '13 at 18:46
  • Nope. Nothing at all renders, not even the Crystal Reports toolbar. It is weird because If I input the Physical Address in the ReportSource control I can see the report load in Visual Studio but not the web browser. – Lord Relix Oct 21 '13 at 18:48
  • Do you have the Crystal runtime installed on your server/machine? Visual Studio obviously has it and will therfore render the report. But you should be getting an error if there was no runtime.....hmmmm. – campagnolo_1 Oct 21 '13 at 18:53
  • Are you running IIS? I'm getting the impression that this post may help you with your troubleshooting. I know it's for a slightly different error and VS2010 but the steps are still valid for other issues. You may have to find the correct runtime for VS2012. Check it out: http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2011/01/12/how-do-i-resolve-bobj-is-undefined-issue – campagnolo_1 Oct 21 '13 at 18:58
  • campagnolo... I thought of that and installed the runtime again but no go. I am running in my local development machine, will try to see if the URL you posted helps me. – Lord Relix Oct 21 '13 at 19:09
  • Will see if completely uninstalling and re-installing helps me =/ – Lord Relix Oct 21 '13 at 19:13
  • I know that's always a drag! Good luck! – campagnolo_1 Oct 21 '13 at 19:14
  • Well, this is frustrating. Completely uninstalled everything, deleted folders, temp files, etc... still same problem. =/ – Lord Relix Oct 21 '13 at 20:28