Reputation: 4247
I have a project with crystal reports version 13 that I am running as part of an MVC 3 .NET application. We have 4 existing detail reports that work correctly.
The problem is that I need to create a new report that has charts, and I cannot get the charts to display at runtime, although they will display OK at design time. This is running locally in visual studio (not in iis).
The problem appears to be because crystal reports generates a file dynamically called crystalimagehandler.aspx, and for whatever reason this isn't being generated on my computer When I run process monitor as thereport is being generated, it produces the following output:
10:01:40.1814627 a.m. WebDev.WebServer40.exe 1692 QueryOpen D:\tfs\chad\Main>\Src\chad\Chad.Website\Reports\CrystalImageHandler.aspx NAME NOT FOUND
I have added the following lines to my web.config
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
(and in system.webServer)
<handlers>
<add name="CrystalImageHandler.aspx_GET" path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
</handlers>
Does anyone have any other suggestions?
Upvotes: 1
Views: 893
Reputation: 4247
The problem was that because this is an MVC Application, I had to tell it to ignore the route to the reports folder. I found the solution in this thread Embedded images not displayed in MVC application
I added the line:
routes.IgnoreRoute("Reports/{*restOfUrl}");
to my Global.asax, and that did the trick.
Note that the web.config setting to add the httpHandler is also a necessary pre-condition for getting the images to display.
Upvotes: 1